Cleanup: Split UV sample geometry node into two functions

This separates the UV reverse sampling and the barycentric mixing of
the mesh attribute into separate multi-functions. This separates
concerns and allows for future de-duplication of the UV sampling
function if that is implemented as an optimization pass. That would
be helpful since it's the much more expensive operation.

This was simplified by returning the triangle index in the reverse
UV sampler rather than a pointer to the triangle, which required
passing a span of triangles separately in a few places.
This commit is contained in:
2022-11-18 13:38:34 -06:00
parent 8fa69dafdd
commit 21adf2ec89
10 changed files with 134 additions and 55 deletions

View File

@@ -30,6 +30,7 @@ struct AddCurvesOnMeshInputs {
/** Information about the surface that the new curves are attached to. */
const Mesh *surface = nullptr;
Span<MLoopTri> surface_looptris;
const ReverseUVSampler *reverse_uv_sampler = nullptr;
Span<float3> corner_normals_su;