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
A custom parallax shader doesn't work with a 3d model
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.
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.
Re: A custom parallax shader doesn't work with a 3d model
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.
This appears to be a problem in the GLDEFS processor. It crashes when parsing the texture in a material shader definition.
Code: Select all
gzdoom.exe!GLDefsParser::ParseMaterial() Line 1272
at \src\r_data\gldefs.cpp(1272)
Re: A custom parallax shader doesn't work with a 3d model
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?
[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?
Re: A custom parallax shader doesn't work with a 3d model
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.
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.
Re: A custom parallax shader doesn't work with a 3d model
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._mental_ wrote: I think we should add at least a message about missing textures.
Re: A custom parallax shader doesn't work with a 3d model
Thank you guys! Sorry, I messed up, I suck at things like these
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
}
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
}