Problem With Materials

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
22alpha22
Posts: 308
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Problem With Materials

Post by 22alpha22 »

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
User avatar
Caligari87
Admin
Posts: 6227
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Problem With Materials

Post by Caligari87 »

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-)
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Problem With Materials

Post by Nash »

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)
User avatar
22alpha22
Posts: 308
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: Problem With Materials

Post by 22alpha22 »

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

Return to “Scripting”