ogon ogon v0.1 · in progress

LODs that keep the windows.

Ogon is the toolkit I'm building to get models ready for my own games. It makes LODs, collision, occluders and repairs, and checks whole folders against the engine they're going to.

The original building, 25,612 triangles
The same building after ogon-lod 1.1, 6,344 triangles
Tris 25,612 Tris 6,344
Drag the line across. On the left is a kit building as it ships. On the right is my LOD of it, with a quarter of the triangles and the windows and pilasters still in place.
  • In progress, for my own games
  • C++23
  • Vulkan 1.3
  • Windows · Linux
  • ~184k lines
  • 1,082 tests
  • 55 tools · 18 recipes

The demo

Recorded straight from the app. A script clicks through Ogon's own buttons while ffmpeg records the screen, so nothing is sped up or cut. The models are a building I made in Blender and nine dogs from Meshy.

Recorded on Windows 11 with a Radeon AI PRO R9700. The times you see on screen are the app's own.

LODs for models that break simplifiers

Game kits are flat shaded, or use one palette pixel per face, or give every quad its own UVs. All three put seams everywhere. A standard simplifier has to keep seams, so on these models it either stalls or, if you let it cross them, tears the model apart.

Five versions of one building: source 25,612 triangles, meshoptimizer 18,060, ogon-lod 1.0 6,345, ogon-lod 1.1 3,641, and 1.1 at 6,344
Each method was asked for 3,201 triangles. meshoptimizer gets stuck at 18,060 and still tears the roof. My first version reaches 6,345 but fills in the windows. Version 1.1 gets down to 3,641, and at 6,344 it keeps every detail. Red shows gaps and missing faces.

What 1.1 does before it removes anything

  1. It looks at the model from 64 directions. Each triangle is weighted by how many directions can see it, so parts nobody sees go first, whole.
  2. Where two normals are more than 30° apart it marks a hard edge, and keeps that edge as a line.
  3. Open borders can only drift a little (an eighth of the allowed error in total), and no triangle can turn more than 60°.
  4. A small part resting on a bigger one goes in one piece, unless sight lines through it hit a face from behind. Then it's a lid, and it stays.
  5. It stops when going further would break the shape, and tells you so, instead of forcing the triangle count.
MethodTrianglesPicture error
Source25,6120
meshoptimizer18,0600.53
ogon-lod 1.06,3451.88
ogon-lod 1.13,6411.55

meshoptimizer's picture error only looks better because it kept 18,060 triangles. It's also 5 to 15 times faster than mine. When both stop at the same count, mine comes out ahead. On a hydrant cut to 20%, its worst error is 2.54% and mine is 1.80%. For animated characters I also check the LOD while it moves, and on a Kenney character at 50% that brings the worst error down from 3.71% to 1.15%.

Side by side in the app

Ogon can run several methods on the same model and lay them out next to each other. This is my Blender building. meshoptimizer can't remove a single seam, so its last LOD still has every triangle. 1.0 gets to 12% and loses the windows. 1.1 stops at 31% and keeps them.

The LODs come out named the way the engine groups them, _LOD0, _LOD1 and so on, for Unity, Unreal or Godot.

Ogon's compare view with meshoptimizer, ogon-lod 1.0 and 1.1
The orange lines are the triangles each method kept.

Collision that fits

V-HACD fills a model with voxels and wraps groups of them in hulls of up to 124 triangles. Cap the hulls to save physics time and they shrink inside the surface, so the model pokes out of its own collision. I cut the mesh along its own planes instead, and give each piece only the triangles it needs. A box gets 12.

A townhouse: original 2,146 triangles, V-HACD 564, V-HACD at 64, ogon-collision 32
The townhouse has 2,146 triangles. V-HACD 4.1 covers it with 564. Squeezed into my budget, it loses the shape. Mine needs 32.
ModelV-HACD 4.1Mine
Townhouse564 tris32 tris
Hydrant988 tris · 1.75 s240 tris · 0.26 s
Doorway16 hulls · 206 tris3 boxes · 36 tris
13 models12,982 tris · 80 s1,570 tris · 3.3 s
Mesh poking out9 of 131 of 13

Characters get one shape per bone

For a skinned character, the skin is shared out among the bones, and each bone gets a capsule, a box, a sphere or a hull that moves with it. It left less skin uncovered than the usual one-capsule-per-bone rule on 26 of 27 characters, and took 0.06 to 1.7 s each.

A character in its bind pose and two animation frames with five collision methods
Bind pose and two frames of animation. From the left: the character, V-HACD on bones, my general method on bones, a PhAT-style rule, the per-bone method, and its shapes drawn over the skin.

The other tools

Each of these is measured against what people normally use. The write-up explains how every one of them works.

Occluders and shadow proxies

An occluder is a few triangles hidden inside a model that let the engine skip drawing whatever is behind it. For buildings, Ogon treats the rooms as solid. It also makes a low-poly shadow caster, set slightly inward, so shadows cost far less.

A 45,122-triangle building gets a 12-triangle occluder that blocks 88.8% of sight lines. It takes 1.3 s.

Occluders for a building: boxes, ogon-occluder 1.0 and 1.1, and the building occluder

Mesh repair

It fills holes so the patch follows the surface around it instead of a flat cap. It also flips faces that point inward, splits edges shared by three faces and clears out loose debris. There's a preset for scans and AI models.

Flat caps flipped 197 faces on 31 real models. Mine flipped none.

A building with a wall missing: damaged, flat caps, my repair 0.1 and 1.0, and the original

Remesh

It rebuilds broken or kitbashed surfaces as one clean mesh and keeps the hard edges sharp.

On a hydrant at 996 triangles, the normal error drops from 8.8° to 0.27°.

Remesh of a townhouse: original, surface nets, ogon-remesh

Hidden faces

It deletes triangles that no camera can ever see. The usual trick, rendering from a ring of cameras, also deletes windows you can see. Safe mode never does.

Across 24 models, safe mode removed no visible faces.

Hidden-face removal: camera views remove 21,028 of 45,122 faces including windows; safe mode removes 68

UVs and lightmaps

It makes fewer, larger charts than xatlas, which means less bleeding at the seams and more of the texture actually used.

Across 29 models, 5,043 charts where xatlas made 8,142.

Lightmap UV layouts and the bakes they give

The app around them

Open a folder and Asset Doctor scores every file for the target engine and platform. From there you run one tool, a recipe, or a node pipeline. Each tool describes its settings once, and the app panel, the command line and the pipeline nodes are all built from that.

Asset Doctor's score for a folder and the list of fixes
Asset Doctor. One score for the folder, and every problem with its fix.
The asset grid with a health score on each file
Assets. Every file scored for Unity URP on a mid-range PC.
Collision result on the building
A result. Ten collision shapes, a list of what's left to check, and an undo.
The recipe gallery
Recipes. 18 chains of tools for common jobs.
The mobile texture recipe after a run
Mobile textures. 21 maps checked and resized in under 10 s.
The node pipeline editor
Pipelines. The same graph runs headless on a build machine.
The tools library
Tools. All 55, from meshes to sprites.

Scroll sideways · click to enlarge

How it's built

Core
Written in C++23 and built with clang and CMake. The real work happens in small libraries for geometry, images, file formats (glTF, FBX, OBJ), commands, jobs and pipeline graphs. Every dependency is MIT, BSD, Apache or zlib licensed.
GPU
Vulkan 1.3 with Slang shaders, used for texture sets, baking and impostors. Ogon picks the GPU by type and features, never by index, and every Vulkan path runs clean under the validation layers.
Tools
Each tool declares its inputs, settings and presets once. The app's panel, the command-line flags, the pipeline nodes and the engine menus are all built from that. Results are cached, and every change to your files goes through a backup first.
Interface
SDL3 handles the window, and the RmlUi interface is drawn by my own Vulkan renderer. It only redraws when something changes, so it costs nothing while it sits idle.
Engine link
Engine plugins talk to Ogon over a local TCP connection. The Godot plugin works today. You right-click an asset, run a tool, and the result comes back as a single undo step.
Testing
There are 1,082 GoogleTest tests, plus sanitizer builds and fuzzing. Every GPU algorithm is checked against a CPU version, and each method is judged by separate scripts that make renders like the ones above.

Not done yet

  • Nothing has been imported into Unity or Unreal and checked there. The Unity plugin is untested and there's no Unreal plugin.
  • Texture compression covers BC1, BC3, BC4 and BC5. No BC7, ASTC or ETC2 yet.
  • Most methods were tuned on the same 10 to 30 example models they're judged on.
  • My LOD, collision and occluder methods are slower than the standard tools. I traded speed for shape.

Read how each method works, with every number and where it comes from.