[Fixed] [4.2.x] Powerup.ColorMap no longer works

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[4.2.x] Powerup.ColorMap no longer works

Postby Major Cooke » Mon Jan 13, 2020 11:59 am

Code: Select allExpand view
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.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

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

Postby _mental_ » Tue Jan 14, 2020 3:34 am

Works fine using OpenGL and Vulkan.
Screenshot_Doom_20200114_110531.jpg
It works incorrectly with SoftPoly though.
colormap_softpoly.jpg
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby Rachael » Tue Jan 14, 2020 3:57 am

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Tue Jan 14, 2020 4:13 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Major Cooke » Tue Jan 14, 2020 8:50 am

For the record, I took that picture while in OpenGL mode. But not when using Vulkan.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

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

Postby Rachael » Tue Jan 14, 2020 9:03 am

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Grizzly » Fri Jan 17, 2020 5:41 am

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
Grizzly
 
Joined: 06 Sep 2018

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

Postby Rachael » Fri Jan 17, 2020 5:42 am

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
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Rachael » Sat Jan 18, 2020 5:42 am

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.
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 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby _mental_ » Sat Jan 18, 2020 7:04 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby dpJudas » Sat Jan 18, 2020 7:17 am

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?
dpJudas
 
 
 
Joined: 28 May 2016

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

Postby _mental_ » Sat Jan 18, 2020 9:47 am

I reworked applying of customized invulnerability colormap in this PR. Testers and reviewers are welcome.
_mental_
 
 
 
Joined: 07 Aug 2011

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

Postby Rachael » Sat Jan 18, 2020 9:53 am

Looks good to me. I was probably going to do something similar to that but I hadn't gotten around to it.
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 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest