Enhanced palette emulation in Raze

Enhanced palette emulation in Raze

Postby markanini » Fri Feb 28, 2020 11:11 am

To my eyes the default option with palette emulation disabled reduces the quantization artifacts of the original, greatly improving atmosphere IMO. The downside is that the colors hues and saturation get shifted around, resulting in a generally dull and off-looking colors. This made me consider a way of combining the pluses of both modes using a shader. As a proof of concept I have prepared a ReShade package.
https://www.dropbox.com/s/4snzt7l71ur0e ... e.zip?dl=0
Extract it into your Raze directory, run Reshade Setup, and it should get picked up on startup. Just remember to leave palette emulation disabled. Currently only Blood is supported.

Disabled/Enabled/Mine

(Click to see animation)

(Click to see animation)
Last edited by markanini on Fri Feb 28, 2020 4:18 pm, edited 2 times in total.
markanini
 
Joined: 18 Jan 2020

Re: Enhanced palette emulation in Raze

Postby Graf Zahl » Fri Feb 28, 2020 11:22 am

markanini wrote:To my eyes the default option with palette emulation disabled reduces the quantization artifacts of the original, greatly improving atmosphere IMO. The downside is that the colors hues and saturation get shifted around, resulting in a generally dull and off-looking colors.


Actually, I think it's the palette shades that look off. This same shift to red can be observed in all of the Build games in the brown colors which makes me believe that the generation tool was bugged, because aside from this quirk the shade tables are relatively well composed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Enhanced palette emulation in Raze

Postby markanini » Fri Feb 28, 2020 12:16 pm

Thanks for the feedback!
markanini
 
Joined: 18 Jan 2020

Re: Enhanced palette emulation in Raze

Postby markanini » Fri Feb 28, 2020 1:52 pm

For Shadow Warrior

(Click to see animation)

(Click to see animation)

Download: https://www.dropbox.com/s/b9qp2ku4te9mn ... e.zip?dl=0
Last edited by markanini on Sun Mar 01, 2020 5:20 pm, edited 2 times in total.
markanini
 
Joined: 18 Jan 2020

Re: Enhanced palette emulation in Raze

Postby Phredreeke » Fri Feb 28, 2020 2:32 pm

Graf Zahl wrote:This same shift to red can be observed in all of the Build games in the brown colors which makes me believe that the generation tool was bugged, because aside from this quirk the shade tables are relatively well composed.


Maybe, maybe not. It brings to mind the CGA palette of all things, where the dark yellow has its green intensity halved.
User avatar
Phredreeke
 
Joined: 10 Apr 2018
Discord: phredreeke#6500

Re: Enhanced palette emulation in Raze

Postby Graf Zahl » Fri Feb 28, 2020 3:56 pm

You mean the EGA palette, don't you? That's the one with 16 colors.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Enhanced palette emulation in Raze

Postby Rachael » Fri Feb 28, 2020 3:59 pm

That was introduced with CGA, though only for text mode, but yeah, that's the one.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Enhanced palette emulation in Raze

Postby Phredreeke » Fri Feb 28, 2020 4:04 pm

The CGA palette is 16 colors, the EGA palette is 64 colors but for compatibility reasons limited to the 16 colors of the CGA palette in the 320x200 and 640x200 modes. Of course, CGA can't display all 16 colors at once except in text modes.
User avatar
Phredreeke
 
Joined: 10 Apr 2018
Discord: phredreeke#6500

Re: Enhanced palette emulation in Raze

Postby markanini » Fri Feb 28, 2020 4:29 pm

OP updated with animations for easy comparison.

Graf Zahl wrote:Actually, I think it's the palette shades that look off. This same shift to red can be observed in all of the Build games in the brown colors which makes me believe that the generation tool was bugged, because aside from this quirk the shade tables are relatively well composed.

BTW, don't you think it's a bigger problem that browns a reds tend toward dark lime? I see a bit of the tissue you are talking about, you might find with it's not as much with my method.
markanini
 
Joined: 18 Jan 2020

Re: Enhanced palette emulation in Raze

Postby Graf Zahl » Fri Feb 28, 2020 4:47 pm

markanini wrote:BTW, don't you think it's a bigger problem that browns a reds tend toward dark lime? I see a bit of the tissue you are talking about, you might find with it's not as much with my method.


The red tint of browns was what I noticed first, but I find any kind of color change in such a shade table problematic - these aren't as bad as Heretic, though - that one is doing some really weird voodoo.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Enhanced palette emulation in Raze

Postby markanini » Sat Feb 29, 2020 7:45 am

At least with a title like Blood they have an excuse for such color shifts. :wink:
markanini
 
Joined: 18 Jan 2020

Re: Enhanced palette emulation in Raze

Postby Fox666 » Thu Mar 05, 2020 9:20 pm

Graf Zahl wrote:
markanini wrote:To my eyes the default option with palette emulation disabled reduces the quantization artifacts of the original, greatly improving atmosphere IMO. The downside is that the colors hues and saturation get shifted around, resulting in a generally dull and off-looking colors.


Actually, I think it's the palette shades that look off. This same shift to red can be observed in all of the Build games in the brown colors which makes me believe that the generation tool was bugged, because aside from this quirk the shade tables are relatively well composed.

I don't see anything wrong with Blood's shade table.

By superimposing a black gradient over the palette, I get very similar results converting the palette in Photoshop.

I think it's just a visual thing, the game relies too much on indigo or yellow colors, and when darkened the closest match is brown.

markanini wrote:To my eyes the default option with palette emulation disabled reduces the quantization artifacts of the original, greatly improving atmosphere IMO. The downside is that the colors hues and saturation get shifted around, resulting in a generally dull and off-looking colors. This made me consider a way of combining the pluses of both modes using a shader. As a proof of concept I have prepared a ReShade package.
https://www.dropbox.com/s/4snzt7l71ur0e ... e.zip?dl=0
Extract it into your Raze directory, run Reshade Setup, and it should get picked up on startup. Just remember to leave palette emulation disabled. Currently only Blood is supported.

That's very interesting, it seems to be doing a good job in preserving the contrast of the original ART.

Did you achieve that by averaging the RGB shifts for each color index in the shade table?

EDIT: Looks like you just overlayed the images, using the hue of one and the brightness of another.
User avatar
Fox666
 
Joined: 24 Feb 2011

Re: Enhanced palette emulation in Raze

Postby Graf Zahl » Fri Mar 06, 2020 12:56 am

Fox666 wrote:
Graf Zahl wrote:
markanini wrote:To my eyes the default option with palette emulation disabled reduces the quantization artifacts of the original, greatly improving atmosphere IMO. The downside is that the colors hues and saturation get shifted around, resulting in a generally dull and off-looking colors.


Actually, I think it's the palette shades that look off. This same shift to red can be observed in all of the Build games in the brown colors which makes me believe that the generation tool was bugged, because aside from this quirk the shade tables are relatively well composed.

I don't see anything wrong with Blood's shade table.

By superimposing a black gradient over the palette, I get very similar results converting the palette in Photoshop.

I think it's just a visual thing, the game relies too much on indigo or yellow colors, and when darkened the closest match is brown.


That may be and if only one game showed that trait I'd just blame it on the available colors - but I've seen the same red-shift quirk not only in Blood but also in RR and SW. And it's only visible in a very narrow range of hues that's virtually identical in all games. That's what made me suspect that the color matching algorithm tends to have a slight red bias.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Enhanced palette emulation in Raze

Postby Teddipetzi » Fri Mar 06, 2020 1:08 am

Graf has a point. I also noticed that the palette emulation tends to exaggerate red in some colors.
It doesn't really bother me that much in Blood or Redneck Rampage,balthough I still prefer the more natural look of the true color option, but in Shadow Warrior it really put me off, it affects too many colors and gives the entire scene an unnatural look if brown - especially reddish browns are the predominant color.
Teddipetzi
 
Joined: 17 Aug 2019
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Enhanced palette emulation in Raze

Postby markanini » Fri Mar 06, 2020 3:15 am

Fox666 wrote:Looks like you just overlayed the images, using the hue of one and the brightness of another.

Correct. EDIT:Actually I stacked a truecolor layer in Photoshop in luminosity mode, thereby passing through hue and saturation. Same thing for the Hald CLUT I made for my shader. My solution works right for fullbright sectors. An internal shader in Raze with the same function would work ideally in a all circumstances.
markanini
 
Joined: 18 Jan 2020

Next

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests