Page 1 of 1

Palette mode in Heretic

Posted: Sun Mar 17, 2019 8:51 pm
by Stingy McDuck
Hello.

I wanted to report how Heretic behaves with the "Palette" tonemap option. It's usually pretty accurate to the SW look, but it kinda struggles with some shades of blue . Example:

SW:
[imgur]https://i.imgur.com/uXtKg0p[/imgur]

OpenGL, Palette ON:
[imgur]https://i.imgur.com/y7BB1uN[/imgur]

See the difference? It also happens with the ice patches and water (they turns slightly pinkish in the distance, at least to my eyes). BTW, something similar happens with Hexen:

SW:
[imgur]https://i.imgur.com/CrV6QK3[/imgur]

OpenGL, Palette ON:
[imgur]https://i.imgur.com/blJPx0P[/imgur]

I wonder if there is something that could be done. I know I could use software mode, but I enjoy many of the OpenGL features, especially anisotropic filtering and antialiasing.

Thanks for your time.

[edit] Image links fixed - Enjay [/edit]

Re: Palette mode in Heretic

Posted: Mon Mar 18, 2019 12:53 am
by Graf Zahl
The Heretic colormap is hand-built, unlike the one in Doom which is just a regular fade to darkness. The tonemap shader only takes the true color output and maps it to a smaller color set, so it is limited by how the hardware renderer calculates light fading. To get a closer result, this would have to be implemented as a custom light fading algorithm and I am sorry to say I do not know what was used here for the original colormap.

Re: Palette mode in Heretic

Posted: Mon Mar 18, 2019 1:34 am
by Rachael
What might be doable (and I honestly would've done it by now if I knew more about how to do it and if it didn't seem so complex) is to output 8-bit textures on a single channel (i.e. red) and map the color fader to a COLORMAP texture, mapped the same way (only on the red channel) and fades the color a mapping on that texture. As for alpha mixes, it's also possible to export the RGB256k texture similarly and calculate blends based on that.

Then after all that is said and done - map whatever resulting 0.0 to 1.0 * 255 to the appropriate reference on a separate truecolor PLAYPAL texture, which if I understand correctly, is how the software renderer already works.

Of course, if this is done, texture upscaling and filtering would have to be forced off. There's no way you could make such systems work in a setting like this. You'd probably also have to disable material shaders unless they are marked as being specifically designed for this.

Re: Palette mode in Heretic

Posted: Mon Mar 18, 2019 2:50 pm
by Stingy McDuck
I see, that would explain the weird looking white fog in Hexen too. It's a shame, Heretic and Hexen look more vibrant in SW mode (in certain scenes, at least). I'll stick to 8bit software rendering for these two then.

Thank you both for answering my question.

EDIT:
I did some thinkering with brightmaps. It's not exactly the same, but it gets the idea. Here are some comparisons of SW vs Opengl WITHOUT palette mode.


vs
[imgur]https://i.imgur.com/CrV6QK3[/imgur]


vs
[imgur]https://i.imgur.com/uXtKg0p[/imgur]

Re: Palette mode in Heretic

Posted: Tue Aug 18, 2020 2:43 pm
by FeelingShred
Stingy McDuck wrote:Hello.

I wanted to report how Heretic behaves with the "Palette" tonemap option. It's usually pretty accurate to the SW look, but it kinda struggles with some shades of blue .
Do you want what is being portrayed in this video? (opengl looking like the software version but using opengl renderer)
https://www.youtube.com/watch?v=lGUeWXvB1tI

[youtube]https://www.youtube.com/watch?v=lGUeWXvB1tI[/youtube]

This already exists, since December 2012. It was a volunteer contribution from an user of the forums, outside of the main dev team.
If you want to test this, download version 1.9.1 from 2016 and activate "Lighting Mode: Software" under Display Options.

Re: Palette mode in Heretic

Posted: Wed Aug 19, 2020 1:28 am
by Graf Zahl
You know, it's a real shame that this guy did some tinkering with the brightmaps but then chose not to post them. He disappeared right after making that post and never came back.