-
-
Notifications
You must be signed in to change notification settings - Fork 22.4k
Shader: Fix the default behavior when mat uniforms are null #106592
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: Fix the default behavior when mat uniforms are null #106592
Conversation
d9c943b
to
9aa0166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editor code should not be in the scene/
folder. There are a few places where it is unavoidable, but I don't think this is one of those places since this only impacts mat
types and not the other types. I think you should take a look at how other types are handled and then see if mat
is just missed somewhere
I think the reason is that when the ShaderMaterial and Shader are newly created, the material parameters are not set, but get_property_list has already generated default values as properties. The default values of mat (and color alpha I guess, not tested yet) are not zero. Perhaps this behavior should also be fixed for the game, not just for the editor |
9aa0166
to
996680b
Compare
Pushed another solution. The alpha of color is already handled before |
996680b
to
d97948d
Compare
d97948d
to
4621d3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thank you for taking another look and finding a better solution
Thanks! |
Fixes #106561.