Paints a heat-map texture by rasterising a per-vertex scalar field
into UV space.
Pipeline:
Project. Pick two of the AABB's three axes for the UV plane.
With worldUp supplied and the geometry not flat in that axis,
V is aligned with up; otherwise the smallest-extent axis is
dropped (same heuristic as attachSceneModelMaterials).
Map. Each vertex's compressed position becomes a UV in
[0, 1]² directly — the AABB-normalised position on the picked
axes. No tiling; the texture covers the projection exactly once.
Rasterise. For each triangle, scan-convert in pixel space and
barycentric-interpolate the vertex scalars. The interpolated
scalar is normalised to [0, 1] against the active range and
sampled through the colour ramp.
Compose. Pair the colour map with flatNormal (no
heightfield — the field carries its own variation) and a
constant mr from the supplied roughness/metallic. Diffuse
heat-map colour reads cleanly under the standard PBR shading.
The returned uvs field is the only set that will display the
heat-map correctly; reusing the texture with a different UV layout
is meaningless.
Triangles whose UV projection collapses to a line (zero area in the
picked plane — e.g. a wall's edge-on triangles when the wall is
thin in the dropped axis) are skipped. Pixels not covered by any
triangle keep backgroundColor.
Paints a heat-map texture by rasterising a per-vertex scalar field into UV space.
Pipeline:
worldUpsupplied and the geometry not flat in that axis, V is aligned with up; otherwise the smallest-extent axis is dropped (same heuristic asattachSceneModelMaterials).[0, 1]²directly — the AABB-normalised position on the picked axes. No tiling; the texture covers the projection exactly once.[0, 1]against the active range and sampled through the colour ramp.flatNormal(no heightfield — the field carries its own variation) and a constantmrfrom the supplied roughness/metallic. Diffuse heat-map colour reads cleanly under the standard PBR shading.The returned
uvsfield is the only set that will display the heat-map correctly; reusing the texture with a different UV layout is meaningless.Triangles whose UV projection collapses to a line (zero area in the picked plane — e.g. a wall's edge-on triangles when the wall is thin in the dropped axis) are skipped. Pixels not covered by any triangle keep
backgroundColor.