Palette mode in Heretic

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Post Reply
Stingy McDuck
Posts: 2
Joined: Sun Mar 17, 2019 8:31 pm

Palette mode in Heretic

Post 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]
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Palette mode in Heretic

Post 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.
User avatar
Rachael
Posts: 13571
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Palette mode in Heretic

Post 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.
Stingy McDuck
Posts: 2
Joined: Sun Mar 17, 2019 8:31 pm

Re: Palette mode in Heretic

Post 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]
FeelingShred
Posts: 2
Joined: Sat Mar 25, 2017 5:37 am

Re: Palette mode in Heretic

Post 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Palette mode in Heretic

Post 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.
Post Reply

Return to “Technical Issues”