Problem With Materials

Thu Oct 28, 2021 6:13 am

I've never used materials in GZDoom before so I'm probably doing something wrong but I have a PBR bullet model and in Blender it renders properly but in GZdoom it doesn't. In GZDoom the model has a weird blueish-green color and doesn't have any metallic properties. I have a normal map, ao map, metallic map, and rough map, I've placed them in the auto materials directory, so I'm at a loss to explain what is not working.

A couple of screenshots:



I've prepared a simple example demonstrating my problem. Load it up and summon "Test" to spawn the model. I had to use my Dropbox as the file is too large to be an attachment, this is because the model's texture and maps are all very high res at 2048x2048.
https://www.dropbox.com/s/ms52dm7o83bzpew/Test.pk3?dl=0

Re: Problem With Materials

Thu Oct 28, 2021 9:00 am

As for the materials setup itself I'm not really skilled in that area, but I know that materials need to be lit by attenuated dynamic lights in order for anything besides the diffuse/albedo texture to be visible (since GZDoom doesn't have any "global" lighting by default). So if you don't have any dynamic lights in your scene, you won't see material effects. If you add dynamic lights and still don't see the intended materials, then something's wrong with your material setup.

8-)

Re: Problem With Materials

Thu Oct 28, 2021 9:22 am

Even then, do not expect PBR output in GZDoom to look the same as in Blender - GZDoom's PBR implementation currently is insufficient to handle reflections correctly, which will result in the in-game material to just reflect black.

It is recommended to use diffuse + specular + normal workflow (the opposite of PBR) as, at least, that one is feature-complete and renders properly.

(and as Cali said, there needs to be actual attenuated lights touching the actor for it to affect anything at all)

Re: Problem With Materials

Thu Oct 28, 2021 3:36 pm

Thanks for the help guys, it turns out the problem was it wasn't being illuminated by attenuated lights. When lit by attenuated lights it looks more or less like it should. Having to be lit by attenuated lights to look right does present some major issues, I'll have to rework all the lighting in my maps and I can't very well have all light in the map be dynamic lights, that would destroy performance. I guess these limitations are why there haven't been much use of materials in mods so far. Almost seems kind of pointless without some sort of global illumination.