-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan: MeshInstance3D looses Shader Instance Uniform Color when loaded with a new mesh #58113
Comments
Stumbled upon this same issue and almost created a new issue, but found this so adding my findings here instead: 2023-02-13.22-33-10.mp4Funnily OBS didn't seem to grab the popups when selecting a new mesh nor when changing colors... First I also stumbled upon this issue when working with MeshInstance3D, but this also affects CSGShape3Ds, so the problem might be inherited from GeometryInstance3D(?) It also seems to affect also other types of instance uniforms (or at least floats) in addition to color. It doesn't matter if changing the geometry is done in inspector, running the project or tool script. In MRP I tried several different workarounds (like storing/restoring a duplicated material and the value of the instance uniform) to no avail. I left these with some other tests into MRP so they can be used in tests if found useful. Last issue mentioned in the video (values of instance uniforms changing to defaults when shader compilation fails) seems to actually be duplicate of #64057 My MRP: Godot version: v4.0.rc.custom_build [4a2c217] |
I think I've fixed it. Just need to make sure I don't break anything else before submitting PR. |
Fixes godotengine#58113 (cherry picked from commit 26aecbf)
Godot version
v4.0.alpha2.official [79077e6]
System information
Windows 10
Issue description
Changing the mesh of a MeshInstance3D breaks any colorUniform from the shader assigned with Instance Uniform qualifier. While we can still print it's color value.
Editing texturesUniform parameters not instance qualified works fine, but instance uniform colors seems to go black and not respond to any further parameter edits.
Steps to reproduce
1 Create a shader material and assign a color instance uniform to it.
2 Change the MeshInstance3D by doing load(another_mesh_path)
3 Color instance uniforms are perpetually black.
Minimal reproduction project
LoadingMeshBreaksInstanceUniform.zip
The text was updated successfully, but these errors were encountered: