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

View Z-Far distance above 5000 causes SSAO banding in GLES3 #42390

Open
joshchristiane opened this issue Sep 28, 2020 · 4 comments
Open

View Z-Far distance above 5000 causes SSAO banding in GLES3 #42390

joshchristiane opened this issue Sep 28, 2020 · 4 comments

Comments

@joshchristiane
Copy link

joshchristiane commented Sep 28, 2020

Godot Version 3.2.2 Stable
Windows 10 Pro, AMD Ryzen, RTX 2070

Description:
When you increase the view distance of the main viewport (view z-far distance setting) beyond about 5000, objects close-up appear to have lines all over them in a weird pattern, see image attachment for example. This is an issue in every project I've tested so far.

editor_screenshot_2020-09-28T135700-0800

@Calinou
Copy link
Member

Calinou commented Sep 28, 2020

This was already opened as #13129, but I closed that issue as it was fixed in the master branch. However, it still hasn't been fixed in the 3.2 branch.

PS: You generally don't want to set the Z far distance so high due to the limited precision in physics (making the high viewing distance not very useful). I would recommend using a value lower than 4000. Ideally, you should use the lowest Z far distance you can afford to use. See discussion in #33207.

@Calinou Calinou changed the title View Z-Far Distance Above 5000 Creating Lighting Issue View Z-Far distance above 5000 creating SSAO banding in GLES3 Sep 28, 2020
@Calinou Calinou changed the title View Z-Far distance above 5000 creating SSAO banding in GLES3 View Z-Far distance above 5000 causes SSAO banding in GLES3 Sep 28, 2020
@Calinou Calinou added this to the 3.2 milestone Sep 28, 2020
@clayjohn clayjohn removed this from the 3.2 milestone Oct 4, 2020
@clayjohn
Copy link
Member

clayjohn commented Oct 4, 2020

I tested this out and can confirm that it becomes a problem after a z-far of about 5000. However, I'm not sure what the solution is, or if it is worth finding one. I quickly tried using 32 bit depth buffers (for the scene and for the SSAO effect) and the issue didnt go away. This leads me to thinking it may actually be a precision issue in the shader. Which would require a much more complex solution.

The only thing I can think of that would solve this in a satisfactory way would be to cap out the depth of the SSAO effect to something more reasonable like 1000 meters. Anything beyond that just wouldn't receive SSAO. However, even this solution would introduce significant complexity that may not be worth it.

@joshchristiane
Copy link
Author

I agree that generically one shouldn't use a z-far beyond 2000 or maybe 3000... But it is still a problem that should be addressed at some point, especially for games with really big landscapes or calls from large objects really far away. Perhaps a solution could be a simple bool tick box added to objects to allow them to exempt from the z-far "filter" or whatever it's technically called, thus they would always render and be unaffected by the z-far distance. Perhaps there is a way to write a script to do this that I'm unaware of, but I could definitely find a use for that if I can't go beyond say 5000 meters.

@Calinou
Copy link
Member

Calinou commented Jan 7, 2021

I agree that generically one shouldn't use a z-far beyond 2000 or maybe 3000... But it is still a problem that should be addressed at some point, especially for games with really big landscapes or calls from large objects really far away. Perhaps a solution could be a simple bool tick box added to objects to allow them to exempt from the z-far "filter" or whatever it's technically called, thus they would always render and be unaffected by the z-far distance. Perhaps there is a way to write a script to do this that I'm unaware of, but I could definitely find a use for that if I can't go beyond say 5000 meters.

You can probably do something like this in Godot using a shader: https://aras-p.info/blog/2019/02/01/Infinite-sky-shader-for-Unity/

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

5 participants