-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
NODE_POSITION_WORLD and NODE_POSITION_VIEW shader built-ins do not yield the expected results ('model_matrix' : undeclared identifier) #67894
Comments
Cc @paddy-exe |
@clayjohn From testing I can say that there must be a regression between This is how it looks like when it's working in beta 2: _.Test.-.Godot.Engine.2022-10-26.18-05-02.mp4 |
@paddy-exe the issue must be from my double precision changes, I will take a look |
@akien-mga @clayjohn Hello! Seems this problem is still exist, I have same problem for last godot build on MacOS Monterey, graphics: Intel Iris Graphics 550 1536 MB.
and
gives a white screen instead red (as should be on IF condition) |
@alekseym88 this bug report was reporting a shader compilation error that came from using those builtins. The fact that your shader compiles means you are not facing the same issue. Your issue comes from floating point precision. By doing multiple operations, you are losing precision such that the equality operator fails. Take a look at this site for a deeper explanation about how floating point numbers work and why avoiding == between two floats is important |
Godot version
Godot4-beta3
System information
Windows 10
Issue description
The
NODE_*
built-ins implemented in #63597 are currently null/0.UPDATE: By pulling Godot from the master branch, there's now a related crash when using the
NODE_*
built-ins (either in a Shader and VS):To make it easy to visualize for this Issue, I set them both to the Albedo channel, so it would be possible to visualize the RGB colors changing, but no matter where in the world, there are no changes:
Expected - NODE_POSITION_WORLD / World Position
Unity:
UE:
Expected - NODE_POSITION_VIEW / Object Position
Unity:
UE:
Steps to reproduce
Use
NODE_POSITION_WORLD
and/orNODE_POSITION_VIEW
in any shader (VS or GDShader), the result is always0
.Minimal reproduction project
NodePositionSample.zip
The text was updated successfully, but these errors were encountered: