Materials (PBR, Specular, Normal maps)
Posted: Wed Feb 14, 2018 7:36 am
NOTE: This guide requires a recent build of QZDoom from Jan 25 or later. This guide will NOT WORK with GZDoom.
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:
iwad, thiswad, and disablefullbright work the same way they do for GLDEFS brightmap definitions.
Or for PBR materials:
And the auto material folders are as follows:
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.
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
material <flat|texture> <TEXTURENAME>
{
normal <NORMALMAP>
specular <SPECULARMAP>
specularlevel <float>
glossiness <float>
brightmap <BRIGHTMAP>
[iwad]
[thiswad]
[disablefullbright]
}
Or for PBR materials:
Code: Select all
material <flat|texture> <TEXTURENAME>
{
normal <NORMALMAP>
metallic <METALMAP>
roughness <ROUGHMAP>
ao <AMBIENTOCCLUSIONMAP>
brightmap <BRIGHTMAP>
[iwad]
[thiswad]
[disablefullbright]
}
- 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 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.