ClassiCube
ClassiCube copied to clipboard
OpenGL fog weirdness on rendertype normal
There's a weird fog bug on the OpenGL renderer, where the fog on the area outside of the map and the sky/clouds bugs out. This occurs on Windows and Linux, and on the C# and C clients. This issue is fixed with /client rendertype legacy
.
Here's a video: https://s.csnxs.uk/fog.mp4
My GPU is a Radeon RX 580, but this also used to happen with my old Radeon HD 6670. I got my friend to test (he has a GTX 960 on Windows 7) and he couldn't reproduce, so I feel it may be an issue with AMD graphics.
Alas, this is an issue I cannot completely solve. It's caused by OpenGL using per-vertex instead of per-pixel fog, and you can't explicitly enforce which mode get used in the old fixed function pipeline.
Legacy mode only reduces the problem - you'll still see the issue when looking outside the map with short view distances such as 16 or 32.
Something to try is adding a glHint(GL_FOG_HINT, GL_NICEST)
call at the end of Gfx_Init. It didn't change fog for me on intel GPUs, but might actually work on ATI.
I just tried the GL renderer on Windows, and it works fine, this issue seems to no longer occur there anymore (on both the C# and C clients).
It still happens on Linux though, even with glHint(GL_FOG_HINT, GL_NICEST)
.
I get this, I have a ATI Radeon something from 2005-ish.
something potentially related, long runs of blocks have fog issues at view distances lower than around 64, likely due to being meshed into large polygons where the center can be very close to you, but the corners can be almost out of view.
Information from /client gpuinfo
:
-- Using OpenGL (64 bit) --
Vendor: Intel
Renderer: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
GL version: 4.6 (Compatibility Profile) Mesa 23.0.3
Max texture size: (16384, 16384)
Depth buffer bits: 24
VRAM: 7793 MB, HW accelerated
If it's of any note, I don't think this happened on Windows, but can't test ATM as my install got borked for some reason.
Yep it's the same underlying problem - easier to just use the modern OpenGL backend instead, which avoids this altogether