You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything looks very correct in the editor. However, if I turn on preview or try to get the depth_buffer texture, I have the glitches described in the video. Although the Shader behavior is normal in the editor. The Shader itself is taken from the official tutorial. https://youtu.be/BqOoxzMxWP0
Steps to reproduce:
When I switch the camera to orthogonal mode, I get white instead of black. When I move the plane with the Shader away from the camera and it approaches y=0, the main color approaches white, although this should not be the case, because there are no objects deeper. In the editor, everything is displayed normally and as expected. If I get the world coordinates from depth_buffer and perform more complex calculations, taking into account the height of the camera, then both the perspective and orthogonal camera work as expected (in the correct_works_depth Shader). However, if the plane with the depth_buffer Shader is lowered, it also turns white, as if there is a plane in y=0.0 coordinates.
PS. I also noticed that for an orthogonal camera, I can only get the depth buffer, but not the 3D position, since xy is simply not displayed, unlike a perspective camera. I'm not sure that's the way it should be.
The text was updated successfully, but these errors were encountered:
Can reproduce in 4.1.1 after porting the project.
It looks like it lerps from black to white in the interval from the camera near plane to the far plane. The depth shader script lerps it only for perspective cameras, showing white only for orthogonal cameras, whilst the correct_works_depth shader lerps it for both orthogonal and perspective. This behavior only happens in the camera preview and when playing the scene, while in the editor the quad remains always black.
However, apart from inconsistencies in perspective and orthogonal cameras I think this behaviour is intended? The depth buffer goes from 0.0 to 1.0 depending on the distance to the far plane which are interpreted as black and white. I'm a bit confused. The reason why it goes near white when the plane is near y=0 in the OP is because the far plane is set to 30 and the camera is at y=20 pointing down.
Godot version:
3.2.3 stable win64.
OS/device including version:
Windows 10 ver 1607, gtx 1050, GLES 3.
Issue description:
Everything looks very correct in the editor. However, if I turn on preview or try to get the depth_buffer texture, I have the glitches described in the video. Although the Shader behavior is normal in the editor. The Shader itself is taken from the official tutorial.
https://youtu.be/BqOoxzMxWP0
Steps to reproduce:
When I switch the camera to orthogonal mode, I get white instead of black. When I move the plane with the Shader away from the camera and it approaches y=0, the main color approaches white, although this should not be the case, because there are no objects deeper. In the editor, everything is displayed normally and as expected. If I get the world coordinates from depth_buffer and perform more complex calculations, taking into account the height of the camera, then both the perspective and orthogonal camera work as expected (in the correct_works_depth Shader). However, if the plane with the depth_buffer Shader is lowered, it also turns white, as if there is a plane in y=0.0 coordinates.
Minimal reproduction project:
error ortho cam.zip
PS. I also noticed that for an orthogonal camera, I can only get the depth buffer, but not the 3D position, since xy is simply not displayed, unlike a perspective camera. I'm not sure that's the way it should be.
The text was updated successfully, but these errors were encountered: