godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.1k stars 21.15k forks source link

OpenGL: Depth fog renders incorrectly in 4.4.dev #97875

Open goodbyesquare opened 6 days ago

goodbyesquare commented 6 days ago

Tested versions

System information

Windows 11, RTX 4080, i9-13900k, Compatibility Renderer

Issue description

There is a rendering issue with Depth fog that creates a band effect in a circular radius around the camera at certain distances. If the material is textured then it corrupts the texture within the band area. This only affects the compatibility renderer, it doesn't seem to appear in the Forward and Mobile renderers from what I've tested and it doesn't seem to occur in Godot 4.3, just the 4.4 dev versions so I'm guessing some kind of regression happened? It appears in both the editor and in game. I'm honestly surprised nobody else has noticed and reported it as it's extremely obvious. DepthFogRenderIssue

Steps to reproduce

Create a world environment and use depth fog at a specified distance eg. Depth start 50m, Depth end 200m and move the camera around until the halo effect appears.

Minimal reproduction project (MRP)

DepthFogRenderBug.zip

SourceOfHTML commented 2 days ago

Still reproduceable on the latest as of now build (v4.4.dev.custom_build [842f98239]), and messing with the numbers makes me think that this is more closely tied to depth_begin, since that more directly affects the band.

The closer depth_end is to depth_begin, the more the band is blurred, which I'm assuming is perfectly normal behavior.

I reckon this was the result of a dev debugging some other issue and forgetting to delete some debugging lines.

SourceOfHTML commented 1 day ago

I don't trust myself enough with rendering to continue on this, apologies. Another, more experienced dev will have to take over.