sezero / quakespasm

QuakeSpasm -- A modern, cross-platform Quake game engine based on FitzQuake.
https://sourceforge.net/projects/quakespasm/
GNU General Public License v2.0
227 stars 96 forks source link

Fog blending/banding issues #76

Closed Flecked42 closed 1 year ago

Flecked42 commented 1 year ago

QuakeSpasm

spasm0000

Ironwail

w1m7_2023-08-21_13-58-27

I cranked gamma/contrast to max to see it better.

Map is w1m7 from SMEJ https://www.quaddicted.com/filebase/smej_1.13.zip

sezero commented 1 year ago

If it's restricted to that map only, then it's minor. Unless someone has a well-tested patch for it..

In any case, is the issue present in latest release (0.95.1), or is it a regression in git?

sezero commented 1 year ago

CC: @ericwa, @andrei-drexler

Flecked42 commented 1 year ago

I used the latest release 0.95.1

the banding would happen in many maps with fog

spasm0000

Flecked42 commented 1 year ago

Novum mentioned something about using a "10bit color buffer" https://github.com/sezero/quakespasm/issues/47#issuecomment-1418247674

sezero commented 1 year ago

If you or others have a well-tested patch, I'd review and apply it. Otherwise, this will stay as is.

andrei-drexler commented 1 year ago

The map uses a grey fog with a value of 0.01, so in an 8-bit framebuffer there are basically at most 4 distinct color values between black and full-intensity fog (inclusively). Cranking up the gamma/contrast only makes things worse. A 10-bit framebuffer would indeed help, but there would still be significant banding with these exaggerated gamma/contrast settings. Besides the 10-bit framebuffer IW also adds a microscopic amount of dithering to all the shaders specifically to avoid banding, but I think that might be a bit overkill for QS.

Flecked42 commented 1 year ago

Thanks for the info. Yea the gamma/contrast was way exaggerated just to show it better.

sezero commented 1 year ago

OK then. Closing as WONTFIX.