TSL: Avoid naming collision when using label()
or toVar()
.
#29813
Labels
TSL
Three.js Shading Language
label()
or toVar()
.
#29813
Description
When using
label()
ortoVar()
to give variables a name, collisions can occur when the name is already reserved for internal entities like uniforms or varyings.If you now redefine a variable on app level, a shader error occurs. In WGSL for example:
Solution
It would be nice if the node material could automatically detect such name collisions and modify the custom names e.g. with a suffix.
Alternatives
Leave it as it is and ask developers to pick unique names.
Additional context
#29810
The text was updated successfully, but these errors were encountered: