Should NODE_POSITION_WORLD and NODE_POSITION_VIEW be renamed? #8642
Kadmioo
started this conversation in
General Discussions
Replies: 1 comment
-
Renaming a built-in constant breaks existing shaders unless a deprecated constant with the original name is added. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
NODE_POSITION_WORLD
andNODE_POSITION_VIEW
are built-in properties present both in vertex and fragment spatial shaders.They have the same name and the same description in the documentation, but they work in different ways. In a vertex shader, these built-ins return the position of the mesh, but in a fragment shader they return the position of the node. This can cause confusion to beginners or to people who don't know how shaders work in-depth, since there are nodes that can have multiple meshes with different positions.
The return value of these properties cannot be changed, so I suggest renaming them and changing their description in the documentation.
For example, in vertex shaders, these built-ins could be renamed to
MESH_POSITION_WORLD
andMESH_POSITION_VIEW
, and their description could be changed to:Beta Was this translation helpful? Give feedback.
All reactions