[4.2.x] Powerup.ColorMap no longer works

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

[4.2.x] Powerup.ColorMap no longer works

Post by Major Cooke »

Code: Select all

class InvS : PowerupGiver
{
	Default
	{
		+COUNTITEM
		+INVENTORY.AUTOACTIVATE
		+INVENTORY.ALWAYSPICKUP
		+INVENTORY.BIGPOWERUP
		Inventory.MaxAmount 0;
		Powerup.Type "PowerInvulnerable";
		Powerup.Colormap 0.0, 0.0, 0.0, 1.0, 1.0, 1.0;
		Inventory.PickupMessage "$GOTINVUL";
	}
	States
	{
	Spawn:
		PINV ABCD 6 Bright;
		Loop;
	}
}
"Give InvS" in console. You'll see no colormap is applied. This is most likely related to the InverseMap changes that were made.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [4.2.x] Powerup.ColorMap no longer works

Post by _mental_ »

Works fine using OpenGL and Vulkan.
Screenshot_Doom_20200114_110531.jpg
It works incorrectly with SoftPoly though.
colormap_softpoly.jpg
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Rachael »

This is probably a NYI thing in SoftPoly. Keep in mind the shader functions in SoftPoly are extremely time-sensitive - every new check or function you put in here will likely result in a FPS hit even when they are not active.

I think I could code in a colormap shader pretty easily, but I don't trust myself to be able to optimize it well, because I tend to favor code organization and moddability over speed. This probably needs dpJudas's SSE2 methods.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Graf Zahl »

I'm not sure if SSE2 is capable on operating on a byte target. The best course of action might be to create an 18 bit lookup table and then let 3 or 4 threads run over the image, translating each pixel. Doing such a uniform transformation ad-hoc per pixel may just be too slow.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Major Cooke »

For the record, I took that picture while in OpenGL mode. But not when using Vulkan.
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Rachael »

Okay, from my test, it appears that this problem only occurs if you turn the custom invulnerability colormap on. If you have it off from the very moment you start GZDoom, it does not appear to occur.
User avatar
Grizzly
Posts: 49
Joined: Thu Sep 06, 2018 7:12 am

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Grizzly »

Rachael wrote:Okay, from my test, it appears that this problem only occurs if you turn the custom invulnerability colormap on. If you have it off from the very moment you start GZDoom, it does not appear to occur.
I can not confirm this. For me, running on softpoly, the Colormap simply doesn't work. This is on an installation that has never even touched the custom setting.
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Rachael »

That's because it's not been done at all on SoftPoly. I was referring to OpenGL/Vulkan, there's more than one issue here.
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Rachael »

Looks like dpJudas snuck this in so now all that remains is for me trying to fix the custom colormaps, themselves... if I can find the code that activates them.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [4.2.x] Powerup.ColorMap no longer works

Post by _mental_ »

The problem is in loosing all colormaps (except five hardcoded) added with AddSpecialColormap(). At least, R_InitColormaps() cannot be used to apply custom invulnerability colors.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: [4.2.x] Powerup.ColorMap no longer works

Post by dpJudas »

The code I added just tries to what the hardware renderer does already.

That said, I don't understand why the colormap shader reduces it to a blend when it could have uploaded the special colormaps as textures and applied them as a LUT. Is it just how the code evolved historically or there a deeper reason?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [4.2.x] Powerup.ColorMap no longer works

Post by _mental_ »

I reworked applying of customized invulnerability colormap in this PR. Testers and reviewers are welcome.
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [4.2.x] Powerup.ColorMap no longer works

Post by Rachael »

Looks good to me. I was probably going to do something similar to that but I hadn't gotten around to it.
Post Reply

Return to “Closed Bugs [GZDoom]”