Bring a material's colour-source defines in line with source, and report
whether anything changed.
The colour-source twin of syncMeshEmissionDefines, and it exists for the
same reason: at most one colour-source define is ever set is an invariant
across two backends, so implementing it twice would let a unit test asserting
"never both" prove only that both copies happen to agree today.
It is a live failure mode rather than a theoretical one, and worse than the
emission case. USE_COLORMAP and LUXAR_MESH_BASE_COLOR_TEX both write the
base colour, so a material that stranded one while adding the other would
compile fine and silently ignore whichever the shader happened to test second —
a mesh that reads its texture attrs, uploads the image, binds the UVs, and then
renders in colormap colours, with nothing anywhere reporting a problem.
Write-side exclusivity does not remove the need for this. add_mesh refuses
texture alongside colors/colormap, but a material is also mutated at
RUNTIME by the layers panel, which can turn a colormap on for a node whose
store never had one.
Bring a material's colour-source defines in line with
source, and report whether anything changed.The colour-source twin of syncMeshEmissionDefines, and it exists for the same reason: at most one colour-source define is ever set is an invariant across two backends, so implementing it twice would let a unit test asserting "never both" prove only that both copies happen to agree today.
It is a live failure mode rather than a theoretical one, and worse than the emission case.
USE_COLORMAPandLUXAR_MESH_BASE_COLOR_TEXboth write the base colour, so a material that stranded one while adding the other would compile fine and silently ignore whichever the shader happened to test second — a mesh that reads its texture attrs, uploads the image, binds the UVs, and then renders in colormap colours, with nothing anywhere reporting a problem.Write-side exclusivity does not remove the need for this.
add_meshrefusestexturealongsidecolors/colormap, but a material is also mutated at RUNTIME by the layers panel, which can turn a colormap on for a node whose store never had one.