Materials (PBR, Specular, Normal maps)

Handy guides on how to do things, written by users for users.
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Materials (PBR, Specular, Normal maps)

Postby Talon1024 » Wed Feb 14, 2018 8: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:

Code: Select allExpand 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 allExpand view
material <flat|texture> <TEXTURENAME>
{
    normal <NORMALMAP>
    metallic <METALMAP>
    roughness <ROUGHMAP>
    ao <AMBIENTOCCLUSIONMAP>
    brightmap <BRIGHTMAP>
    glossiness <float>
    [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.
Last edited by Talon1024 on Tue Mar 06, 2018 8:01 pm, edited 4 times in total.
Talon1024
 
Joined: 27 Jun 2016

Re: [QZDoom] Materials (PBR, Specular, Normal maps)

Postby Talon1024 » Mon Mar 05, 2018 10:59 pm

Updated 2018/03/05: Corrected info about PBR materials, and added info about auto materials.
Talon1024
 
Joined: 27 Jun 2016

Re: Materials (PBR, Specular, Normal maps)

Postby Tormentor667 » Wed Mar 07, 2018 2:17 am

Would you mind adding some kind of information on what each material layer/folder actually does? For a total newbie when it comes to such things, I have no idea how to create each layer and how to control each layer.
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Materials (PBR, Specular, Normal maps)

Postby Major Cooke » Thu Mar 08, 2018 4:46 pm

What I'd be most interested in is a guide on how to generate them the best way possible.
User avatar
Major Cooke
The road to Hell is really paved in the corpses she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Materials (PBR, Specular, Normal maps)

Postby Chris » Thu Mar 08, 2018 7:57 pm

Here is what a quick search turned up.
User avatar
Chris
 
Joined: 17 Jul 2003

Re: Materials (PBR, Specular, Normal maps)

Postby ramon.dexter » Wed Mar 21, 2018 7:52 am

Yes, the link provided covers allthe topics.
But I'm wondwring if there is any guide, that will guide me how to make the required maps MANUALLY - So, I have a texture, and I want to add materials. I have never done such a thing, so I need some basic guide. Is there any guidelike this? Also, I dont like any automatic processes (like input texture, and process will throw out materials), I want to paint the materials maps by hand. But I dont know how, also I dont know if there are any do's and don't do's.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Materials (PBR, Specular, Normal maps)

Postby Nash » Wed Mar 21, 2018 11:08 am

@ramon.dexter try this: http://www.opengl-tutorial.org/assets/i ... iniTut.jpg

And yes, agreed, don't throw everything into an automatic generator, more often than not the results will come out lame as fuck. Actual artistic talent is needed to make PBR or diffuse/normal/specular look good.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Materials (PBR, Specular, Normal maps)

Postby ramon.dexter » Wed Mar 21, 2018 3:50 pm

Nash: Great, many thanks!

I found some normal map generator, but the result was...well, terrible.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Materials (PBR, Specular, Normal maps)

Postby HAL9000 » Wed Mar 21, 2018 7:31 pm

Ok,I need some help. I made quick Pillar 3D PBR model from scratch for testing purposes.
(Painted to be full PBR metallness roughness compatible)

Here are some Gifs from Imgur:
HQ render:
https://i.imgur.com/SHfCMOl.gif
Realtime PBR
https://i.imgur.com/k1b2MHc.gif


I followed the provided qz/gzdoom PBR info, but only Classic Normal/Gloss/Spec Shading is working atm for me.
I can't get PBR (metalness/roughness) to work in Gzdoom (g3.3pre-658-gfae6f22a2)

Some Shots of Gloss/Spec shader running in Gzdoom.
https://i.imgur.com/dcDt3Zu.png
https://i.imgur.com/DcwImTZ.png

Does anyone have more info how to get PBR(metalness roughness) working in GZ ?
Thanks
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: Materials (PBR, Specular, Normal maps)

Postby ZeHatsu » Sun Mar 25, 2018 11:13 pm

Major Cooke wrote:What I'd be most interested in is a guide on how to generate them the best way possible.

Substance Designer and Substance B2M are fantastic tools for this, though they are pretty costly.
User avatar
ZeHatsu
 
Joined: 11 Dec 2017

Re: Materials (PBR, Specular, Normal maps)

Postby Talon1024 » Mon Mar 26, 2018 6:18 pm

For non-PBR materials, you need:
  1. Specular map
  2. Normal map

For PBR materials, you need:
  1. Normal map
  2. Roughness map
  3. Metalness map
  4. Ambient Occlusion map

None of these maps are optional. For example, if you're missing the Ambient Occlusion map for a PBR material, the material won't work.

The sword from the demo PK3 (which is from OpenGameArt) didn't have an ambient occlusion map, so I imported the model into Blender and baked an ambient occlusion map in Blender.

I hope this helps clear some things up.
Talon1024
 
Joined: 27 Jun 2016

Re: Materials (PBR, Specular, Normal maps)

Postby HAL9000 » Tue Mar 27, 2018 10:29 am

It is working Perfectly.
Also, I have noticed it only works with dynamic lights atm

Some SShots of Sexy light Reflections on PBR models
https://i.imgur.com/qVWCNzn.jpg
https://i.imgur.com/nTHAFX8.jpg

Also it would be a nice feature if we could set the "amount of Metalness/Roughness" from 0 to 100% similar as Gloss/Spec

Code: Select allExpand view
specularlevel 0.5
glossiness 0.3


example idea:
Code: Select allExpand view
metalnesslevel 50
roughnesslevel 100


Btw Substance painter is pretty affordable at price of 20$/month,
I used it for almost a year so far, its totally worth the price.
Last edited by HAL9000 on Tue Apr 17, 2018 6:16 am, edited 1 time in total.
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: Materials (PBR, Specular, Normal maps)

Postby Indecom » Wed Mar 28, 2018 1:54 am

Will these materials work for equipped weapon sprites or does that use a separate shader? If so, how much work would it be for me to get a comparable effect on an equipped sprite?
User avatar
Indecom
Check out QuakenDoom 2, my Q2 TC for Doom 2
 
Joined: 13 Jul 2009

Re: Materials (PBR, Specular, Normal maps)

Postby dpJudas » Wed Mar 28, 2018 3:19 am

I haven't tried, but I think it uses the right shader. Unfortunately it only applies dynamic lights as an uniform color there - you won't be able to get such effect on a psprite.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Materials (PBR, Specular, Normal maps)

Postby Mynameislol » Fri Mar 30, 2018 4:41 am

Here's some normal maps & specular maps, they need to be renamed & configured properly to work

https://drive.google.com/drive/folders/ ... sp=sharing

All credit goes to mpobers
User avatar
Mynameislol
 
Joined: 02 Feb 2017

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests