Vixen
02b45cc4
csharp
public static class ClusterAttributes

Recovering a pixel's attributes from the triangle it landed on — phase 5's reconstruction, and the definition both the resolve and its tests are held against.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Phase 5 of docs/plan/22-virtualized-geometry.md. A visibility buffer stores which triangle covered a pixel and nothing else, so everything an interpolator would have handed the fragment stage — the world position, the normal, the texture coordinate, and the rate at which the coordinate changes — has to be worked out again from the triangle's three corners and the pixel's own position.

The mirror exists because two of the three steps fail silently. Solving the weights in screen space and using them directly is the classic affine-texturing error: the image is plausible, straight lines bend, and a texture swims across a floor as the camera moves. Correcting the weights but not their derivatives is subtler still — the picture is then right and only the mip selection is wrong, which reads as a texture that is slightly too sharp at grazing angles. Neither is a crash and neither is visible in a still. Improvement 4 of the plan is exactly this argument.

Analytic, not from a quad. A resolve dispatched over tiles has no quad to take derivatives against — and even a fragment-stage resolve, which does, would be taking them across a neighbour that may belong to a different triangle of a different cluster. That is wrong precisely at the silhouettes where it is most visible, which is why the plan says the gradients come from the triangle plane rather than from ddx.

Fields and properties (1)

  • public const float Epsilon

    Below which the solve's reciprocal is not finite enough to use.

Methods (8)

Used by (1)

  • ClusterAttributeTestsVixen.Rendering.Tests