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

Shader gets null matrix by default while the inspector shows it should be identity #43230

Open
Zylann opened this issue Oct 31, 2020 · 1 comment

Comments

@Zylann
Copy link
Contributor

Zylann commented Oct 31, 2020

Godot 3.2.3
Windows 10 64 bits
OpenGL ES 3.0 Renderer: GeForce GTX 1060 6GB/PCIe/SSE2

I wrote a custom shader in my project which involves a custom matrix in one of its uniforms, but all the material previews using that shader are black.
I tracked this down to a matrix that ended up being filled with zeroes, even though the inspector shows it should be identity:

image

The bug goes away as soon as I modify the matrix manually to be slightly different than default, then it keeps working if I set it back to default. If the value is reverted from the .tres (for example as a result of "properties == default values not being saved"), the problem comes back.

Reproduction project:
BlackMaterial.zip

@lawnjelly
Copy link
Member

Wild guess, the default is probably identity on the client side, but unset (zero) in the visual server. The client doesn't update the server when it is default, so doesn't update until it is changed. Then when it is set back to identity it works, because the update happens. There have been several bugs of this type.

Can't check this until back home. If so the solution we usually used was to set a proper default in visual server side (or alternatively you could force setting even the default value).

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

3 participants