[Closed] v4.4.2 - Brightmaps not working anymore with parallax shader

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

v4.4.2 - Brightmaps not working anymore with parallax shader

Postby Batandy » Wed Jul 01, 2020 6:37 am

Hello, I noticed recently that the parallax shader i'm using for some of the textures is now ignoring if they got brightmaps, while it used to work fine before.

Image
This screenshot was taken almost a year ago when I added these parallax mapped square windows, notice that the glass part is completely bright.
Image
Screenshot taken today with the latest version of Gzdoom, notice how dark they are in comparison.

To be completely honest, i'm not 100% that it's a Gzdoom issue, but that said, I haven't touched the code at all since i've added it, so it's something that just popped out outta nowhere.

Here's a test map with these textures (and the shader code under shaders/texture/ in the pk3), would it be possible for you to check it out?

https://drive.google.com/file/d/1aL_bDU ... sp=sharing
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Graf Zahl » Wed Jul 01, 2020 6:46 am

The way brightmaps get used has changed in 4.4.x to lift some technical limitations - they no longer are a separate shader but get handled in the core shader itself so they can be combined more easily with other effects.. This may occasionally require a change to custom shader. I'll have a quick look later.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Ozymandias81 » Wed Jul 01, 2020 7:59 am

Batandy, on BoA we have fixed this way, as Graf said you have to remove optional if statements and set it absolute
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Batandy » Wed Jul 01, 2020 11:15 am

Ozymandias81 wrote:Batandy, on BoA we have fixed this way, as Graf said you have to remove optional if statements and set it absolute


I've removed the if brackets here:
Code: Select allExpand view
void SetupMaterial(inout Material material)
{
    mat3 tbn = GetTBN();
    vec2 texCoord = ParallaxMap(tbn);

    material.Base = getTexel(texCoord);
    material.Normal = GetBumpedNormal(tbn, texCoord);
    material.Specular = texture(speculartexture, texCoord).rgb;
    material.Glossiness = uSpecularMaterial.x;
    material.SpecularLevel = uSpecularMaterial.y;
    material.Bright = texture(brighttexture, texCoord);
}


It runs, but still doesn't work.
Can you guide me more precisely through this? I'm kinda cornered.
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Ozymandias81 » Wed Jul 01, 2020 2:07 pm

Mmh I need to download the file and check how your shader is structured, maybe very late tonight I'll give it a look and come with a solution
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Batandy » Thu Jul 02, 2020 1:32 am

I just managed to get it working, thank you all for the help.

I think this thread can be closed, as it's not a bug thread anymore and the "issue" has also been resolved.
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Graf Zahl » Thu Jul 02, 2020 1:50 am

For completeness, how did you address this? Just in case someone else comes here later with a similar issue.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Batandy » Thu Jul 02, 2020 4:41 am

Graf Zahl wrote:For completeness, how did you address this? Just in case someone else comes here later with a similar issue.


Oh yeah, exactly like I've posted above, by removing the If block and keeping only the material.bright line
Code: Select allExpand view
void SetupMaterial(inout Material material)
{
    mat3 tbn = GetTBN();
    vec2 texCoord = ParallaxMap(tbn);

    material.Base = getTexel(texCoord);
    material.Normal = GetBumpedNormal(tbn, texCoord);
    material.Specular = texture(speculartexture, texCoord).rgb;
    material.Glossiness = uSpecularMaterial.x;
    material.SpecularLevel = uSpecularMaterial.y;
    material.Bright = texture(brighttexture, texCoord);
}


I just forgot to update the GLDefs yesterday since I was kinda tired. After setting up the brightmaps properly there it worked with no issues!
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: v4.4.2 - Brightmaps not working anymore with parallax sh

Postby Ozymandias81 » Thu Jul 02, 2020 5:48 am

Cool then, I wasn't able to fix it somehow but it was very late night... As a modwise suggestion, to fast things you could use auto folders for materials instead to nest them on custom folders (and mmh I am not sure how much it works using brightmaps as specular on some occasions), this way you'll only have to declare shader and custom parallax texmap.
For the auto folder I mean create a Materials folder and include these: normalmaps, brightmaps, specular and the custom parallax folder. Beside parallax which won't be automatically recognized, just give other materials same name of target texture, and inside brightmaps add the auto folder too (use same rule as for pbr materials as I said, same sprite name), dropping this in case you missed this detail.
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars
Github ID: Ozymandias81
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests