Skip to content

Library API

Matthew Scott edited this page Nov 21, 2026 · 1 revision

Library API

using NormalBake.Core;
using NormalBake.IO;

Mesh high = ObjReader.ReadMesh("high.obj");
UvMesh low = ObjReader.ReadUvMesh("low.obj");   // must already have UVs

BakedMap map = NormalBaker.Bake(high, low, new NormalBakeOptions
{
    Resolution = 2048,
    Samples = 4,
    Map = MapType.Normal,
});

PngWriter.Write("normal.png", map);              // or DdsWriter / ExrWriter

Multi-part assets bake each piece against only its own high-poly, so nothing bleeds between parts:

var parts = NormalBaker.MatchByName(highsByName, lowsByName);   // pairs crate_low with crate_high
BakedMap atlas = NormalBaker.BakeParts(parts, options);

Bake also has an overload taking IProgress<float> and a CancellationToken for long bakes. FBX and glTF inputs load through FbxReader and GltfReader.

Clone this wiki locally