Updated 2018/03/05: Corrected info about PBR materials, added info about auto materials.
GZDoom dev builds support materials now!
If you've been following the QZDoom commit log, dpJudas has been working on adding support for specular maps, normal maps, and PBR maps (roughness, metalness, and ambient occlusion).
To make your own materials, you have to provide the relevant texture maps, and then define them in GLDefs, or put them in the auto material folders. At the very least, you need a normal map and a specular map for "classic" materials, or a normal map, a metalness map, a roughness map, and an ambient occlusion map for PBR materials.
A material definition looks like this:
- Code: Select all • Expand view
material <flat|texture> <TEXTURENAME>
{
normal <NORMALMAP>
specular <SPECULARMAP>
specularlevel <float>
glossiness <float>
brightmap <BRIGHTMAP>
[iwad]
[thiswad]
[disablefullbright]
}
iwad, thiswad, and disablefullbright work the same way they do for GLDEFS brightmap definitions.
Or for PBR materials:
- Code: Select all • Expand view
material <flat|texture> <TEXTURENAME>
{
normal <NORMALMAP>
metallic <METALMAP>
roughness <ROUGHMAP>
ao <AMBIENTOCCLUSIONMAP>
brightmap <BRIGHTMAP>
[iwad]
[thiswad]
[disablefullbright]
}
And the auto material folders are as follows:
- materials/brightmaps/auto or brightmaps/auto for brightmaps.
- materials/normalmaps/auto for normal maps.
- materials/specular/auto for specular maps.
- materials/metallic/auto for metalness maps.
- materials/roughness/auto for roughness maps.
- materials/ao/auto for ambient occlusion maps.
You can use GLDefs definitions if you want to fine-tune your materials' lighting characteristics. Also, if you are using full path textures (long texture names in GZDoom Builder), you will need to define your materials manually in GLDefs. Auto materials will not affect textures with long/full path names.
You can also apply material definitions to 3D model textures, but you'll need to have the model reference the textures. GZDoom and QZDoom use shader names in MD3s as texture names. If you use shader names in your MD3 model, be sure they match the names of the textures specified in the material definitions.
Also, only attenuated lights are affected by "classic" diffuse/specular/normal textures. Only PBR materials (metalness/roughness/ao/normal) are also affected by non-attenuated lights.
Here is a demo for those interested.