You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Visual Shader editor, if the output of a set of nodes only connects to a VaryingSetter, any Parameter nodes will fail to declare themselves in the generated code. This causes an error in the shader when the missing parameter is accessed, breaking the whole shader.
This happens in both the Vertex and Fragment functions (that I've tested) and with different types of parameters.
Steps to reproduce
To Reproduce:
Create a new visual shader
In one of the shader functions (for example Vertex) create a new varying with the "manage varyings" button
Add a varying setter node and set it to the new varying
Add a parameter node of an appropriate type and connect to the varying setter
Click on the "show generated shader code" button, you should see the unknown identifier error
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
For anyone else having this issue, you can work around this by manually declaring the uniform parameter in a global expression node. Unfortunately this will cause another error for redefining the parameter if for some reason the parameter is being declared properly by the node.
Looks like the shader code generated for parameter nodes are wrong when connected to varying (did not generate the uniform declaration) , but when connected to something like output, it's fine.
Also when add a bool varying shader compiler failed bacause of flat cannot declare a bool variable.
Godot version
v4.0.2.stable.mono.official [7a0977c]
System information
Windows 10
Issue description
When using the Visual Shader editor, if the output of a set of nodes only connects to a VaryingSetter, any Parameter nodes will fail to declare themselves in the generated code. This causes an error in the shader when the missing parameter is accessed, breaking the whole shader.
This happens in both the Vertex and Fragment functions (that I've tested) and with different types of parameters.
Steps to reproduce
To Reproduce:
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: