Reverse brightmaps (Darkmaps?)

Requests go in THIS forum!

Reverse brightmaps (Darkmaps?)

Postby TDRR » Mon Sep 16, 2019 1:12 am

What i'm looking for is basically brightmaps that instead of making a pixel fullbright, make the surface darker depending on the input image's brightness on that pixel. I did this by editing func_brightmap.fp and replacing the + with a -, but even for my standards that's too hacky.

So i'm wondering if anyone with more knowledge could make a custom shader that did this. Thanks in advance for any help.

EDIT: Would also be nice if it was half resolution since i'm planning to use it with high-res textures, but it's not strictly necessary.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Reverse brightmaps (Darkmaps?)

Postby Graf Zahl » Mon Sep 16, 2019 5:03 am

Why is this 'too hacky'? That's precisely how I'd do it, too. To make the process more intuitive you might also try a negative scale, i.e. make white the neutral color and let darker colors affect the output.
Regarding resolution, that's automatic for texture layers, having a brightmap or any other layer will always map the layer texture to the full size of the base texture.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Reverse brightmaps (Darkmaps?)

Postby TDRR » Mon Sep 16, 2019 11:19 am

Graf Zahl wrote:Why is this 'too hacky'? That's precisely how I'd do it, too. To make the process more intuitive you might also try a negative scale, i.e. make white the neutral color and let darker colors affect the output.
Regarding resolution, that's automatic for texture layers, having a brightmap or any other layer will always map the layer texture to the full size of the base texture.


It's "too hacky" because it would require me to pretty much distribute a separate gzdoom.pk3 (Or can i override it in a separate file?) and even if i could do it externally, it would completely remove all normal brightmap functionality.

But, if you think it's fine, then i guess all i need is that you tell me a way to invert the original image's colors before processing it, since right now brighter in the image equals darker in game.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Reverse brightmaps (Darkmaps?)

Postby Graf Zahl » Mon Sep 16, 2019 2:33 pm

I thought you considered the implementation hacky.
Unfotunately the engine has no concept of negative color values so I guess the hardware shader route is the only way to go here.
The needed shader won't look much different from what you already have. The brightmap isn't really much more than a predefined hardware shader that only affects the lighting, not the texture.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Reverse brightmaps (Darkmaps?)

Postby TDRR » Mon Sep 16, 2019 2:50 pm

Graf Zahl wrote:I thought you considered the implementation hacky.
Unfotunately the engine has no concept of negative color values so I guess the hardware shader route is the only way to go here.
The needed shader won't look much different from what you already have. The brightmap isn't really much more than a predefined hardware shader that only affects the lighting, not the texture.


Okay, got it. I'm going to read up on all this fancy shader stuff and see if i can make one easily.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)


Return to Requests

Who is online

Users browsing this forum: No registered users and 1 guest