public static class CardGeneratorFits up to six cards to a mesh's geometry — doc 19 § L4's offline half.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Triangles vote by their dominant normal axis. Each of the six directions collects the triangles whose normals lean its way, and a direction that gathered any area gets a card fitted to those triangles' bounds — grown by a margin so the capture's rays start outside the surface rather than on it. Ties at exactly forty-five degrees go to the smaller axis index, one rule stated once, because a tie broken by float noise is a card that flickers between two shapes across a rebake.
Resolution follows world size, clamped. Texels per world unit is the quality knob and a maximum keeps one huge floor from eating the atlas; a card never drops below one texel, because a card that exists represents its surfaces at whatever fidelity it was given — the atlas budget decides what exists, not this.
Methods (1)
public static List<SurfaceCard> Generate(ReadOnlySpan<Vector3> positions, ReadOnlySpan<int> indices, float texelsPerUnit = 8, int maxResolution = 64, float margin = 0.05)Fits cards to a triangle mesh.
Used by (1)
- SurfaceCacheTestsVixen.Rendering.SurfaceCache.Tests