Author Topic: ObjReader 4.00+ - the .ORB challenge  (Read 24183 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 2013
    • zapsolution
ObjReader 4.00+ - the .ORB challenge
« on: August 25, 2025, 12:18:51 pm »
ObjReader 4.00+ - the .ORB challenge

New in version 4.00:

TL;DR: A compact binary format for Wavefront models that loads faster, takes less disk space, needs no extra DLLs, and stays fully compatible with OBJ/MTL.

What is .ORB?
.ORB = ObjReader Binary. It’s a compound file format for ObjReader that preserves Wavefront OBJ/MTL compatibility while dramatically reducing size and load time.

File layout
  • PNG thumbnail — preview of the model (visible in Windows Explorer thumbnail view).
  • Header — a small block storing internal offsets to each data section.
  • Compressed geometry — mesh data matching the source Wavefront OBJ.
  • Compressed MTL trailer — verbatim copy of the original .mtl file, stored at the end.
Compression: to avoid extra dependencies, .orb uses Windows’ built-in LZNT1 (NTDLL, LZ77-based). No external DLL required.

Explorer thumbnail

The thumbnail embedded in a [.orb] file is created the first time you open the model in ObjReader.
ObjReader renders the current viewport with its OpenGL pipeline (gl_DrawScene) and stores that live capture as the file’s preview.

What it reflects:
  • Geometry, materials, and textures actually loaded
  • Camera position and FOV
  • Active lighting preset and background
  • The model’s current pose/orientation
Why it matters: it lets you recognize models at a glance in Explorer and file pickers. The thumbnail is only a preview—it does not affect the model data.

Integration
  • File association: .orb is registered to launch ObjReader directly from Explorer.
  • ObjReader 4.00 size: the new executable is 14 KB smaller than v3.00+, thanks to aggressive code optimization and compiler settings.
  • ORDLL64 / ORV64: ORV64 and ORDLL64.dll are updated to understand .orb directly; ORV64 can open .orb even if no .mtl is present on disk.
Round-trip compatibility
  • Export from .ORB: ObjReader adds a menu option: File ? Export .ORB to .MTL/.OBJ.
  • Console tool: orbtool.exe provides standalone compile/decompile:
Compile  (OBJ ? ORB): orbtool -c <input.obj> -o <output.orb>
Decompile(ORB ? OBJ): orbtool -x <input.orb> -o <outputBase>
     (produces <outputBase>.obj and <outputBase>.mtl)


Why this is good
  • Smaller files on disk.
  • Faster loads in memory.
  • No extra runtime dependencies (uses Windows’ own LZNT1).
  • Still Wavefront-compatible (verbatim .mtl preserved; lossless geometry).
Overall performance
  • Disk space: ~50% of the original OBJ/MTL size (typical).
  • Loading speed: Up to 10× faster on large models (no text parsing; contiguous, precompiled geometry).
...
New in version 4.01:
  • Complete VS2022 source code (for posterity).
  • Further code reduction (binary now ~478 KB).
  • Menu simplification (removed unused features).
  • New Orbit & Pan inertia (toggle in Animation → Camera inertia (Orbit & Pan)).
  • Mesh info tips totally reworked to resolve conflicts when Use popup tips is enabled.

New in version 4.02:
  • Auto sync detection adjustment for improved audio-driven animation stability.
  • New #inflate directive (expand/deflate geometry along normals).
  • New #autorotate directive (automatic rotation with configurable axis & speed).
  • Zoom inertia added to complement LMB orbit & RMB pan inertia.
  • Better keyboard handling for +/- rotation speed adjustment.
  • Higher-ratio compression when building .orb files.
  • Smarter .mtl change detection to auto-refresh the .orb when materials are updated.
  • New Save screenshot UI icon for one-click snapshot capture.
  • Wireframe overlay cleanup (crisper edges, skips transparent meshes).
  • Toast animation polish for smoother transitions.
  • List view horizontal scrollbar no longer shown at first display (fixed).
  • Both orbtool and ORDLL64.dll reworked to stay in sync with OR v4.02.

...
Attachments
  • ObjReader Version 4.02, is attached to this post.
  • Orbtool console utility, is attached to this post.
« Last Edit: September 24, 2025, 03:30:43 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 2013
    • zapsolution
ORV_64 Version 3.20 - the .ORB challenge
« Reply #1 on: August 26, 2025, 12:23:06 pm »
About ORV_64 v3.20
(sample app for embedding ObjReader via ORDLL64.dll.)



What it is
ORV_64 is a complete C/C++ (VS2022, x64) example that hosts the ObjReader engine through ORDLL64.dll.
The DLL exposes a focused C API, just enough to create a viewer window, load a model, animate it, and query stats.
So you can render ObjReader content inside your own application UI.

What ORDLL64.dll is
  • The embeddable runtime of ObjReader (Win64).
  • Owns the renderer, model loading (.orb, .obj/.mtl), animation timer, and optional audio sync.
  • You supply the top-level window and message loop; the DLL creates and manages its child viewport.

Why v3.10 matters,  native .ORB compatibility
  • Cuts startup time (no text parsing/reindexing).
  • Reduces disk size for large meshes.
  • Simplifies packaging: ship model.orb + textures in the same folder.
Your code can prefer .orb and automatically fall back to .obj when needed.

Typical integration flow
  • Create your main window (CreateWindowExW).
  • Call OR_CreateWindow(...) to create the viewer child HWND.
  • (Optional) OR_SetSwapInterval(TRUE) for V-sync, OR_TimerEnable(TRUE) to animate.
  • Load a file via:
Code: [Select]
OR_ProcessCommandLine(L"path\\to\\model.orb");
  • On WM_SIZE, resize the child window.
  • Populate your UI with getters (OR_Vertices(), OR_Triangles(), …).
  • Offer controls: OR_ViewReset(), OR_Get/SetAudioVolume(), OR_Screen_Shot().
  • On exit, call OR_CloseAll().
API at a glance (what you’ll actually use)
  • Create/host: OR_CreateWindow, OR_CloseAll
  • Open model: OR_ProcessCommandLine (accepts .orb and .obj)
  • Animation & timing: OR_TimerEnable, OR_GetAniTick
  • Display options: OR_SetSwapInterval, OR_ViewReset, OR_Screen_Shot
  • Info for UI:
    • OR_Version, OR_ObjFileName
    • OR_Vertices, OR_Triangles, OR_Indices
    • OR_Meshes, OR_Materials, OR_ObjSize, OR_LoadTime
    • OR_DetectGPU, OR_GPUinfo, OR_GPU, OR_CPU
  • Audio: OR_GetAudioVolume, OR_SetAudioVolume
Attachment
  • ORV_64 Version 3.20, is attached to this post.
« Last Edit: September 24, 2025, 03:23:58 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 2013
    • zapsolution
About OR Version 4.02
« Reply #2 on: September 24, 2025, 03:39:47 pm »
ObjReader v4.02 released

New material directives, improved navigation, and multiple refinements to both the UI and the .orb workflow.
Make sure to use "File" -> "Load model..." and select the demo project to see the new features in context.

New in version 4.02:
  • Auto sync detection adjustment for audio-driven animations.
  • New directives: #inflate and #autorotate.
  • Zoom inertia to complement LMB orbit & RMB pan inertia.
  • Better keyboard handling for plus/minus keys when adjusting rotation speed.
  • .ORB improvements: higher compression + auto-refresh on .mtl changes.
  • UI/UX: new Save screenshot icon, polished toast animation, cleaner wireframe overlay, fixed list view scrollbar at first display.
  • Both orbtool and ORDLL64.dll updated in sync with OR v4.02.

See on top of this thread for new attachments.
« Last Edit: September 24, 2025, 03:50:11 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 2013
    • zapsolution
Re: ObjReader 4.00+ - the .ORB challenge
« Reply #3 on: February 18, 2026, 06:31:15 pm »
ObjReader / orbtool — New GLB Import Feature

I am pleased to introduce a new capability recently added to orbtool:

Direct .GLB → .ORB conversion

This allows modern asset pipelines (Blender, Maya, etc.) to feed ObjReader without relying on the legacy OBJ stage.

------------------------------------------------------------

Why GLB?

GLB is the binary form of glTF and provides several practical advantages:

• compact binary structure 
• faster parsing 
• embedded geometry, materials, and textures 
• fewer ambiguities than text-based formats 

That said, GLB is NOT intended to become a runtime format inside ObjReader.

ORB remains the native, optimized container designed for fast loading and deterministic behavior.

The workflow is intentionally simple:

Code: [Select]
DCC Tool → GLB → orbtool → ORB → ObjReader

GLB acts as an asset source, while ORB stays the final runtime format.

------------------------------------------------------------

Architecture Notes

• GLB parsing is strictly isolated inside orbtool 
• No glTF code is introduced into the runtime engine 
• ORDLL remains lightweight and rendering-focused 
• CRT-free discipline is preserved 

This separation ensures the viewer stays fast and avoids dependency creep.

------------------------------------------------------------

Early Results

Initial integration shows:

• controlled binary growth 
• stable conversion 
• preserved materials 
• clean mesh extraction 

Further optimizations will follow as the pipeline matures.

------------------------------------------------------------

What This Means

This addition quietly moves ObjReader toward a more modern asset workflow while keeping the engine philosophy intact:

✔ preprocess offline 
✔ load fast 
✔ render immediately 

Exactly what a runtime should do.

------------------------------------------------------------

The latest orbtool version is attached to this post, with its full VS2022 C/C++ source code.
The release folder is provided with a ferrari.glb 3D model for test purpose.

Syntax to convert a .glb into a .orb
orbtool -c ferrari.glb -o ferrari.orb

« Last Edit: March 27, 2026, 10:07:59 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 2013
    • zapsolution
Re: ObjReader 4.00+ - the .ORB challenge
« Reply #4 on: March 27, 2026, 10:13:01 am »
The previous post attachment has been updated, because the new code added to support .glb .gltf, broke the legacy .obj to .orb process.
Patrice
(Always working with the latest Windows version available...)