-
Notifications
You must be signed in to change notification settings - Fork 270
Description
Tested versions
Reproduceable in Redot 4.4, Godot 4.4.1, and Godot 4.5
System information
Windows 10 - Redot v4.4 Stable - Mobile
Issue description
When using a mesh with a shader material using instance parameters, when combined with a next pass that also has one or more instance parameters, the parameter values will be overridden arbitrarily, even without a name or type match. When I add a vec4 colored white to my main shader, then add a vec4 that is black in the next pass shader, as long as the next pass is processing and not optimized out, the instance parameter on the main shader will be treated as black until the value is updated, but will then reset upon reloading the scene. This is significant considering that instance parameter in the next pass is unused, and the next pass is effectively doing nothing. It appears correct in the editor. If I replace the instance parameter in the next pass with a vec3, it will try to adapt that vec3 and also use that parameter instead. If I use an int, it will adapt that int to the vec4 as well.
Steps to reproduce
Using the minimal reproduction project, perform these steps to prove the issue.
- Note that the text mesh's instance parameters are white and black, where white comes from the main shader and black comes from the next pass.
- Try removing the unused instance parameter from the next pass, note that the text becomes white despite that variable being unused.
- Add back the instance parameter, notice the text becomes black again, and click the first (white) instance parameter in the editor to open the color picker, then close it without making changes. You will notice that after closing it, the text has become white, as if the scene has caught up with the editor.
- Save the scene and close it.
- Re-open the scene, you will notice that the text is once again black despite saving it as white. If you repeat these steps they should give the same result.
Minimal reproduction project (MRP)
Metadata
Metadata
Assignees
Type
Projects
Status