public readonly record struct DistanceFieldInstanceOne baked field, placed in a world.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Position, rotation and one scale — not a matrix, and that is the point. A distance field survives being moved and turned, and it survives being scaled by one number: rotate a distance and it is the same distance, scale everything by s and every distance scales by s too. It does not survive a non-uniform scale. Squash a sphere's field along one axis and what comes out is not the ellipsoid's distance function — it over-reports along the squashed axis and under-reports across it, and a tracer reading it steps straight through the surface. Taking a Matrix4x4 here would accept that silently, so the type refuses to be able to express it.
A mesh that genuinely needs a non-uniform scale needs its own bake at that scale. That is what every engine that ships this does, and it is why a field is a property of a mesh asset rather than of a renderer.
Fields and properties (5)
public MeshDistanceField FieldThe baked field, in its own space.
public Vector3 PositionWhere its origin sits in the world.
public Quaternion RotationHow it is turned. Must be normalised.
public float ScaleHow much bigger it is than it was baked. Must be positive.
public BoundingBox WorldBoundsThe world-space box the field covers, which is what a query rejects against.
Methods (4)
public DistanceFieldInstance(MeshDistanceField Field, Vector3 Position, Quaternion Rotation, float Scale)One baked field, placed in a world.
public static DistanceFieldInstance At(MeshDistanceField field, Vector3 position)Places a field without turning or resizing it.
public float Sample(Vector3 world)The signed distance at a world-space point.
public void Validate()Throws if the instance cannot be sampled.
Used by (12)
- ArenaThirdPersonShooter
- ArenaIlluminationThirdPersonShooter
- DistanceFieldInstanceTestsVixen.Rendering.DistanceFields.Tests
- DistanceFieldTracerTestsVixen.Rendering.DistanceFields.Tests
- GlobalDistanceFieldVixen.Rendering.DistanceFields
- GlobalDistanceFieldRendererVixen.Rendering
- GlobalDistanceFieldRendererTestsVixen.Rendering.Tests
- GlobalDistanceFieldTestsVixen.Rendering.DistanceFields.Tests
- ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests
- RenderedSceneTestsVixen.Rendering.DistanceFields.Tests
- ScrollTestsVixen.Rendering.DistanceFields.Tests
- SurfaceCacheRadiosityDeviceTestsVixen.Graphics.Golden.Tests