Skip to content
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

Setting a new mesh to MeshInstance3D breaks shader instance uniforms #66997

Closed
JohanAR opened this issue Oct 6, 2022 · 4 comments
Closed

Setting a new mesh to MeshInstance3D breaks shader instance uniforms #66997

JohanAR opened this issue Oct 6, 2022 · 4 comments

Comments

@JohanAR
Copy link
Contributor

JohanAR commented Oct 6, 2022

Godot version

v4.0.beta.custom_build [61021c0]

System information

Fedora 36 KDE, RTX 3080

Issue description

Creating a MeshInstance3D, assigning a mesh and a material, and setting instance uniforms works as expected. However if the mesh is set again, the instance uniforms stop working until the scene is reloaded.

Does not seem to matter if the material is assigned to the Mesh material, MeshInstance3D material override or the GeometryInstance3D material override.

Steps to reproduce

  1. Load reproduction project with node_3d.tscn
  2. Change the MeshInstance3D's shader uniform "My Uniform" and verify that the shader material modifies the mesh.
  3. Click the root Node3d and increase the "dummy" variable. This is a @tool script so this will trigger the test code that sets a new mesh on the MeshInstance3D node.
  4. Observe that the mesh becomes flat, and the "My Uniform" no longer has any effect on the mesh.
  5. Save the scene, close it, and open it again.
  6. Observe that "My Uniform" works again.

Minimal reproduction project

SetUniformOverrideTest.zip

@Calinou Calinou added this to the 4.0 milestone Oct 6, 2022
@clayjohn clayjohn modified the milestones: 4.0, 4.x Jan 14, 2023
@JohanAR
Copy link
Contributor Author

JohanAR commented Jan 24, 2023

I tried fixing this myself, but I couldn't find the issue as I don't have enough knowledge about the inner workings of Godot rendering.

@lostminds
Copy link

Looks like this may be the same issue: #58113 ?

@JohanAR
Copy link
Contributor Author

JohanAR commented Feb 2, 2023

Looks like the same! Did not find it when searching prior to opening a new issue.

@Calinou
Copy link
Member

Calinou commented Feb 2, 2023

Duplicate of #58113.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2023
@Calinou Calinou removed this from the 4.x milestone Feb 2, 2023
@Calinou Calinou added archived and removed confirmed labels Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants