[Fixed] A custom parallax shader doesn't work with a 3d model

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

A custom parallax shader doesn't work with a 3d model

Postby Matilda Brookbury » Wed Apr 10, 2019 3:31 pm

I tried to apply a custom made material that contains a custom made parallax-mapping shader to a 3d model and GZDoom, both 3.7.2 modern and 4.0.0 don't start with it.

Here are the resources and the test map (map21), it requires doom2.wad

https://drive.google.com/open?id=1y7g7G ... CCHHl8nCxT
Matilda Brookbury
 

Re: A custom parallax shader doesn't work with a 3d model

Postby Rachael » Thu Apr 11, 2019 1:45 am

I mistakenly thought this was a user error at first, but it's not.

This appears to be a problem in the GLDEFS processor. It crashes when parsing the texture in a material shader definition.

Code: Select allExpand view
gzdoom.exe!GLDefsParser::ParseMaterial() Line 1272
   at \src\r_data\gldefs.cpp(1272)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: A custom parallax shader doesn't work with a 3d model

Postby Matilda Brookbury » Thu Apr 11, 2019 3:27 am

Maybe it's because my diffuse texture SP_ROCK1 located in 'textures\SP_ROCK1.jpg'

[CODE]Model StoneGrayGrassy
{
Path "Models\Stones\Rockery"
SKIN 0 "Textures\SP_ROCK1.jpg"
MODEL 0 "StGrayGras.md3"
Scale 0.5 0.5 0.5
zoffset 0
FrameIndex GRA4 A 0 0
}[/CODE]

and PBR's height map is in 'materials/displacement/SP_ROCK1_DISP.

[CODE]material texture "StoneGrayGrassy"
{
shader "shaders/disp_rock1.fp"
texture displacement "materials/displacement/SP_ROCK1_DISP.jpg"
glossiness 10.0
specularlevel 0.5
}[/CODE]

So the parser gets mad about it?
Matilda Brookbury
 

Re: A custom parallax shader doesn't work with a 3d model

Postby _mental_ » Thu Apr 11, 2019 5:29 am

Fixed in ab53509.

The crash is caused by missing StoneGrayGrassy texture.
With the fix it no longer crashes, although it doesn't report any warnings/errors either.
I think we should add at least a message about missing textures.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: A custom parallax shader doesn't work with a 3d model

Postby Rachael » Thu Apr 11, 2019 5:38 am

_mental_ wrote:I think we should add at least a message about missing textures.

I agree - otherwise we're going to get a lot of posts asking why it doesn't work and you know how unlikely those are going to come with examples.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: A custom parallax shader doesn't work with a 3d model

Postby Matilda Brookbury » Thu Apr 11, 2019 8:58 am

Thank you guys! Sorry, I messed up, I suck at things like these :cry:
So should the modeldef look like this:

Model StoneGrayGrassy
{
Path "Models\Stones\Rockery"
SKIN 0 "Textures\StoneGrayGrassy.jpg"
MODEL 0 "StGrayGras.md3"
Scale 0.5 0.5 0.5
zoffset 0
FrameIndex GRA4 A 0 0
}
Matilda Brookbury
 


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests