GZDoom - Material Definition Changes Post 4.11

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

A few years ago, I made a large texture mod for my installation of GZDoom (version 4.10) that included a full set of HD flats, walls, model textures, along with a bunch of PBR material files and parallax/displacement shaders for them. After downloading the 4.14.1 update for GZDoom, most of these now appear to not be working anymore and just appear in game as plain textures with no materials on them.

I have the PBR material files in the appropriate ao/normalmaps/roughness/metallic "auto" folders, with the displacement shader being separately defined in GLDEFS. I did some testing and it appears that all of the affected textures are ones that have a displacement map defined in GLDEFS, but rely on the "auto" folders for assigning the PBR maps. After playing about a bit more with individual textures, I discovered that I can still get it working, but if I'm using a custom shader that needs to be manually defined in GLDEFS, I now also have to manually define every PBR map for it in GLDEFS too otherwise it just will not work. Seems like the "auto" option for material maps is now all or nothing, meaning we cannot combine manual and automatically defined materials? I've done some rollbacks with previous versions to find out where this started and it appears to have started on version 4.11.

I'm just wondering if this is by design and, if so, can I do anything to correct this issue other than fully define every single texture in GLDEFS (which would be a bit of a pain for me as there are hundreds of them,) or am I just doing something else wrong?

Any advice or assistance would be hugely welcome. If this is just the way things work now, then that's cool and I accept that, but I would be interested to know why this change was made.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

I guess nobody has any clues about this...?
User avatar
Kappes Buur
 
 
Posts: 4175
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Re: GZDoom - Material Definition Changes Post 4.11

Post by Kappes Buur »

I do not use shaders myself, do not know much about them, but it would be interesting to know how, exactly, you install shaders in your project.

Which version of GZDoom are you using?
Which files are you loading into GZDoom?
What Rendering API are you using?

Can you give us the log file?
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

Thanks for the response!

As per my post, version 4.10 is the last release that worked properly. Any version beyond that breaks the materials (I've tried all of them after that, right up to the latest one.) Nothing has changed in my mod, so something is definitely different in the way the shaders/materials are being handled now. I'm using no other mods other than the one I've described in my post and this is loaded via a simple open "FILTER" folder structure rather than a PK3 as it's massive in size; pretty much every texture in the game is modified with PBR materials and/or some form of displacement or environment shader, and most of the sprites have been replaced by models with PBR materials.

The shaders are defined in GLDEFS for each texture as per the documentation: -
Spoiler:
PBR materials are then added to these via the "auto" folder structure.

This was working previously before version 4.11, but now I have to define every material in GLDEFS as well as the shader for it to work. The problem seems to be some sort of change in the way the automatically assigned material maps work with custom shaders.

I am using the Vulkan renderer.

There is nothing I can see in the log files that is helpful, which is why I haven't posted them. Here is a copy anyway, for completeness and in case I've missed something.
Spoiler:
Spoiler:
User avatar
Kappes Buur
 
 
Posts: 4175
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Re: GZDoom - Material Definition Changes Post 4.11

Post by Kappes Buur »

Do you have any problem when playing GZDoom 4.14.2 without HD-Overhaul-Doom?
Untick the Extra Graphics.



If that works for you, then it would be appropriate to dig into the code of that resource,
or provide a link to that resource to have someone else check it out.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

HD-Overhaul-Doom is the mod I have created and is what has stopped working. It has all the HD textures, PBR materials, 3D models, shaders, and definition files required for my HD overhaul of the Doom resources. It contains over 8000 files and overrides pretty much every resource included in the base WADs and the GZDoom PK3 files, fully segmented into the appropriate FILTER folders to cover all variations of the base Doom games. I'm pretty well-versed in the internal structure of mods and how GZDoom's resources work, or I was until after 4.11, it seems. :)

This is why I'm asking about any technical changes to the way materials are loaded at runtime and how that interacts with the shader pipeline as I spent a LONG time going through the documentation and playing about with it to get this all working correctly, so I really don't fancy going through every single texture and creating customised material entries for them in each GLDEFS unless I have no other choice. The whole point of the "auto" feature for assigning material assets to textures is to get around having to do this, but it now appears that how this works when custom shaders are in play may have changed post version 4.11, so I need advice on what to change to make it work the way it did in 4.10 again or else a confirmation that combining automatically assigned materials with custom shaders is not now possible and, ideally, why the change was made.

I hugely appreciate your engagement on this topic, so please don't take this the wrong way, but I think we need Graf or Rachael or someone who is familiar with the internal workings of the material and shader code to chime in here. This isn't really a basic configuration issue!
User avatar
Kappes Buur
 
 
Posts: 4175
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada

Re: GZDoom - Material Definition Changes Post 4.11

Post by Kappes Buur »

Since I do not know how HD-Overhaul-Doom is structured I would suggest to brake it down and introduce one section at a time to find out which part is causing the problem.

So, just add the textures, then add models, then add shaders, etc until the offending part reveals itself. I know it probably will be a lot of work, thus I asked for a link to maybe have others do some of the work.

Browse through the GZDoom releases to find out if something untoward catches your eye.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

Yep, I already did all that and have identified the issue in isolation, which is why I posted here and how I know where the problem lies. This happens if I only use one single texture and nothing else, so there are no possible conflicts in my mod that could be causing this problem.

For clarity, I'll outline the issue again. If I create a material by fully defining everything in GLDEFS, along with the displacement shader, it works fine. If I leave out the displacement shader and just have everything done via the "auto" folders it also works fine and shows the full PBR material in game (obviously without any displacement, though.) If I just define the displacement shader in GLDEFS and rely on the auto structure for the ao/normal/roughness/metallic maps, it breaks and I just get a plain texture in game, not a complex PBR material. This was not the case before version 4.11. I've also tried several different custom shaders and the same happens, so it's not the shader itself either. Seems to me like the way GZDoom builds the materials at runtime has changed. I can no longer combine automatically detected material maps with custom shaders, it's all or nothing.

As I said, I've also gone through every version after 4.10 right up to the current release and cannot see anything that might be causing this. Obviously, there are a lot of changes in some of those releases though, so I am probably missing something, hence me asking you guys for assistance. The developers who wrote the code are far more likely to just know what is happening off the bat and be able advise me appropriately than I am to find out what's happening by just randomly poking around until I stumble upon the answer or, more likely, just end up working around it by completely rewriting all of my GLDEFS, which is what I'm trying to avoid with this thread.
Last edited by RoadRunner on Mon Jun 09, 2025 2:02 pm, edited 1 time in total.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

To make this a bit easier to understand and so you can see it for yourself directly, I have uploaded a pair of PK3 files to GoogleDrive that demonstrate the issue in the simplest way possible. Just drag them onto the GZDoom executable one at a time with no other mods loaded, start a new game, go into E1M1, and look at the floor texture (floor4_8) in the first room.

Both PK3 files are identical apart from the fact that one has everything defined in GLDEFS and one relies on the "auto" folders for the PBR maps. Both of these work correctly in 4.10 and give the exact same results (full PBR materials with displacement) when displayed in game. For any version of GZDoom after that, only the one called "working.pk3" works correctly, the other one just gives plain textures with no PBR materials or displacment maps added.

https://drive.google.com/file/d/1yiVokf ... sp=sharing
https://drive.google.com/file/d/1hvZOF6 ... sp=sharing
bassdj
Posts: 1
Joined: Wed Jul 09, 2025 4:35 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by bassdj »

I was just starting to create some custom textures with normal maps for the first time myself. I spent too much time getting a simple normal map to work when I stumbled upon this thread.
I tried your 'working' demo which I can confirm runs fine in 4.10 but not in 4.14.10 with this change:

material texture floor4_8
{
//shader "shaders/displacement.fp"
//texture displacement "materials/displacement/floor4_8.png"
normal "materials/normalmaps/auto/floor4_8.png"
//metallic "materials/metallic/auto/floor4_8.png"
//ao "materials/ao/auto/floor4_8.png"
//roughness "materials/roughness/auto/floor4_8.png"
specularlevel 8
glossiness 8
}

I don't see any normal map effect when shining on the floor texture with a flashlight while crouching in 4.14.10. The whole floor is lit up as a normal texture.
It does work correctly in 4.10. I see some lighting around the edges of the hexagonal tile.

This makes the situation even worse? I tried different combinations. In 4.14.10 I only see any effect when I enable normal, metallic, ao and roughness in the code above. So you can't just have a normal map for example.
I really hope they fix things again soon in a future release. I think we need to report a bug.
User avatar
RoadRunner
Posts: 12
Joined: Tue Apr 14, 2020 10:59 am
Graphics Processor: nVidia with Vulkan support

Re: GZDoom - Material Definition Changes Post 4.11

Post by RoadRunner »

Yeah, creating normalmaps from scratch is not easy, especially if you're working from a texture rather than a proper diffuse/albedo map and using correct height and surface information exported directly from a 3D modelling application or some such. Just generating height and normal maps (with a tool like AwesomeBump, for example) from a photo or texture that already has lighting information baked into it is an uphill struggle, nevermind also generating the proper PBR maps to go with it!

With regard to your example, that is by design, and always has been AFAIK. When creating materials for GZDoom, all of the map files for the chosen material workflow need to be present otherwise it will not work in-game. For a PBR material like the ones I'm using, you MUST have the all of the following maps present: normalmap / ao / roughness / metallic. You can leave the custom displacement shader out, but all 4 material maps must be present for GZDoom to display a PBR material otherwise it will just show a normal texture. Also, I believe the specular and glossiness values do not do anything when using the PBR workflow, they're for the normal/specular workflow only, so you can leave those out too (this is why they are missing from my original examples.)

If you aren't bothered about PBR and want to make things a bit easier on yourself, you can still use an old-style normal/spacular workflow instead, which only requires the normalmap and the specular to be present. Even in this case though, if only the normalmap is there, it won't work. This has always been the case with GZDoom, even before 4.10.

The GLDEFS documentation is actually pretty good at covering all of this: -

https://zdoom.org/wiki/GLDEFS#Materials

The problem I've been having is that both of those examples should work exactly the same and yet, with any GZDoom version from 4.11 onwards, they do not. Having the material maps in the "auto" folders should mean that we do not need to define them in GLDEFS at all, they should be automatically detected by the game providing the files are there. This is why it works for you in 4.10 even after you added the remarks to GLDEFS excluding them - the files are still being autodetected. For any version after 4.10, autodetection now only seems to work if there are also no definitions attached to the material in GLDEFS.

Return to “Technical Issues”