Open A-Hugh-Mann opened 4 months ago
Does changing the draw order make any difference?
like material_overlay.render_priority = 1
seems to make no difference if render priority is changed.
You need to assign them unique IDs, see:
And see the documentation
Tested versions
Reproducible in Godot v4.3.dev (29b3d9e9e), currently unable to test in other versions at this time.
System information
Arch Linux Vulkan (Forward+) AMD Radeon RX 6600 (RADV NAVI23) AMD Ryzen 9 5900X
Issue description
When adding a material overlay which includes a shader that has instance uniforms to a mesh instance that is already using a shader material that has instance uniforms, that meshes base materials instance uniforms seem to be overritten by the data contained within the instance uniforms of the overlay material.
What doesn't work: If the following code is run, the red channel of the color provided to the instance uniform is overridden by value given to the shader parameter of the overlay shader, in this code example, this will result in red being 0.0 in all meshes, as nobody is writing anything into that, and it defaults to 0.0
What is expected: It should look how it looks if you run the same code, but comment out line 40 to have no overlay to cause this to happen.
Also running any code to modify that "brightness" parameter clearly shows what is happening here. Notice that the overlay material literally does nothing, it immediately has a discard; statement as its entire fragment shader.
Steps to reproduce
Create a new project, create a default scene with a
Node3D
and set it to be the "main scene".attach a script to the root node of that scene with this code:
Minimal reproduction project (MRP)
N / A