-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Godot 4.0: Wrong VIEW vector in light() shader #68881
Comments
I think it's related to the position of Spotlight in your scene. Try to cover the geometry by the light volume completely and the bug will be gone. |
Ah, yes, but there is not much we can do with it. Maybe detecting the orthogonality of the camera in the scene shader and replace the VIEW to |
@Chaosus i think this solution is ok, its not a big problem to use just a vec3(0, 0, 1), but i think in this case better update this info in docs.godotengine.org, as it will be not so obvious for some people |
Right, marked as documentation issue ^^. |
It looks like there was a lot of discussion about this on the Three.js github mrdoob/three.js#17662 They ended up switching it so that orthogonal cameras use a It seems a I wonder if any people are currently relying on the current "incorrect" behaviour. If no one is, then I don't mind changing the |
This was documented in godotengine/godot-docs#8708. Are we leaving this open to track potentially changing the actual behavior, or can it be closed? |
Godot version
4.0.dev (84c404f), and same for 4.0b4
System information
MacOS Monterey 12.0.1, Intel Iris Graphics 550 1536 MB
Issue description
For orthogonal camera, VIEW vector in light() part of shader should be equal vec3(0.0, 0.0, 1.0), but in real this vector has different direction
Steps to reproduce
Add camera, sphere and source of light in your project, add this shader to sphere:
in editor result will be fine:
but in camera view:
As a temporary solution can use just vector vec3(0.0, 0.0, 1.0) instead VIEW
Minimal reproduction project
test_view.7z.zip
The text was updated successfully, but these errors were encountered: