Page 1 of 1
Fog after after palette emulation
Posted: Thu Oct 08, 2020 12:47 am
by markanini
Currently Raze appears to apply fog before palette emulation. Applying it after instead would in theory improve banding, while at the same time keep the original color appearance that's lost in true color mode.
Re: Fog after after palette emulation
Posted: Thu Oct 08, 2020 1:27 am
by Graf Zahl
Fog is part of the shade table, so there is no separate step that could be done. The entire process is identical to what Hexen did with its swamp level.
I cross-checked with VoidSW - what it does is apply two layers of fog - the one baked into the shade table and regular hardware fog on top of it. But that's no longer "palette emulation".
Re: Fog after after palette emulation
Posted: Thu Oct 08, 2020 5:06 am
by markanini
That raises the question, how is fog handled in truecolor mode?
Maybe my idea could be better described as: applying palette emulation to sprites and tiles only.
Re: Fog after after palette emulation
Posted: Thu Oct 08, 2020 5:24 am
by Graf Zahl
In true color mode the shade tables are not used. Instead the defined fog color for the table gets used to create real fog.
Thinking about it, if you use a foggy shade table and want hardware fog it's just like taking shade 0 for everything and applying real fog to it, which is essentially the same as true color mode, just without texture filtering. That should be doable with reasonable effort.
Re: Fog after after palette emulation
Posted: Thu Oct 08, 2020 3:56 pm
by markanini
That sounds good.
Re: Fog after after palette emulation
Posted: Sat Apr 17, 2021 4:06 pm
by Graf Zahl
Palette emulated fog has been removed some time ago because there's no way to make it work right, even palette emulated mode uses true color fog now.
Re: Fog after after palette emulation
Posted: Sat Apr 17, 2021 10:34 pm
by markanini
Are you referring to the Palette postprocessing or the Polymost Palette emulation?
Re: Fog after after palette emulation
Posted: Sat Apr 17, 2021 11:56 pm
by Graf Zahl
Emulation.
Re: Fog after after palette emulation
Posted: Sun Apr 18, 2021 12:00 am
by markanini
I'm seeing some stepped fog. Does this mean the palette is applied on top of the parametric tables?
Re: Fog after after palette emulation
Posted: Sun Apr 18, 2021 12:31 am
by Graf Zahl
No, currently foggy sectors do not use any palette emulation. The reason is that if we want real fog we cannot use the light fading that's baked into the palette.
Keep in mind that palette emulation has absolutely no effecti if a sector is being rendered fullbright - but fog needs to be applied on fullbright colors.
Re: Fog after after palette emulation
Posted: Sun Apr 18, 2021 2:21 am
by markanini
Is it not trivial to separate the palettes effect on the light fading, perhaps by making it part of the fog instead?
Re: Fog after after palette emulation
Posted: Sun Apr 18, 2021 2:30 am
by Graf Zahl
They are totally inseparable. The fog is baked into the lookup tables as light diminishing. Foggy sectors therefore have no fade to black effect at all, they only have fade to fog color effect instead.
Re: Fog after after palette emulation
Posted: Sun Apr 18, 2021 3:13 am
by markanini
Is sounded messy to me in my head, but now I know for sure. I'll still provide some alternate postprocessing LUTs when you are ready, similar to
Pixel Eaters Troo Cullers mod.