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

Bugs that have been investigated and resolved somehow.

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.
Post Reply
Guest

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

Post by Guest »

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
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

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 all

gzdoom.exe!GLDefsParser::ParseMaterial() Line 1272
	at \src\r_data\gldefs.cpp(1272)
Guest

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

Post by Guest »

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?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

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

Post by _mental_ »

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.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

_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.
Guest

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

Post by Guest »

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
}
Post Reply

Return to “Closed Bugs [GZDoom]”