Vixen
dd8b0a81
csharp
public static class AttributeTransfer

docs/plan/41 § D12's stage seven: the output carries the input, or it is useless.

Read the guide page for this →

Remarks

Closest-point queries against the source, driven by TriangleTree. Normals and texture coordinates and colours are interpolated barycentrically at the point the output landed on; face groups are decided by the majority of the area they cover; skinning weights are interpolated, clamped and renormalised. Doc 41 calls this "what makes it useful rather than impressive", and the argument is arithmetic: a four-million-triangle generated blob is not expensive because it is four million triangles, it is expensive because it is four million triangles of noise with no attributes. Five thousand quads that kept them is a pipeline; five thousand quads that did not is a downgrade.

⚠ Face groups are decided by covered area and never by the nearest face, and that is not a micro-optimisation. § D12: nearest-face assignment shreds along a material boundary — the quads either side of it alternate, because which face is nearest flips from one quad to the next — and the result is a sawtooth seam that reads as a UV bug and gets debugged as one for a day. Integrating over the quad instead makes the boundary a monotone chain, because a quad that is mostly on one side is mostly on one side however its corners fell. Measured on a plane split into two groups on a straight line: the sawtooth is AreaSamples-times-cheaper to produce and takes half again as many boundary edges to describe.

⚠ Every query is made from a point inside the output face rather than from the vertex itself. An output vertex on a hard edge is equidistant from both sides of it, so the triangle a closest-point query returns there is whichever the traversal reached first — and the normal, the texture coordinate and the colour it hands back all belong to a face chosen by the shape of a tree. Insetting toward the face's own centroid asks the question the corner is actually asking: what is the source like on my side of the crease. It is the same mechanism that keeps a texture-coordinate seam from being interpolated across.

⚠ The inset is a fraction of the face and never a distance. An absolute nudge is a claim about how big a model is, which is the failure ScaleSafe exists for and which this repository has now been bitten by five times.

Fields and properties (2)

  • public const float CornerInset

    How far a corner query moves toward its face's centroid, as a fraction.

  • public const int AreaSamples

    The lattice a face's area is integrated on, per side.

Methods (1)

Used by (3)

  • AttributeTransferTestsVixen.Geometry.Remeshing.Tests
  • RemesherVixen.Geometry.Remeshing
  • SymmetryPassVixen.Geometry.Remeshing