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.

Re: Materials (PBR, Specular, Normal maps)

Postby cambertian » Sun May 06, 2018 1:17 pm

I've been trying to get normal and specular maps working on a weapon sprite to no avail. Can you only use them on entities?
I tried putting them in the auto folder, renaming them so they don't conflict with the actual sprite, and specifying the full file paths, as well as updating to a dev build from 3.3.2 (which also happened to glitch the graphics, even without a PWAD.)
See attachment.
Attachments
specular.pk3
(9.89 KiB) Downloaded 38 times
User avatar
cambertian
Resident Non-Programming Programmer
 
Joined: 07 May 2015
Location: New England Area, USA
Discord: cambertian#6245

Re: Materials (PBR, Specular, Normal maps)

Postby Indecom » Sun May 06, 2018 2:09 pm

These materials only work on level geometry and imported models
User avatar
Indecom
Check out QuakenDoom 2, my Q2 TC for Doom 2
 
Joined: 13 Jul 2009

Re: Materials (PBR, Specular, Normal maps)

Postby hardcore_gamer » Sun May 06, 2018 3:07 pm

I am a bit confused in regards to how to get pbr on models. I figured it out for wall textures and flats but I can't seem to get them working for a test cube I made.

I can get the model working with just a normal texture merely by placing the texture inside the same folder as the md3 model, but when I place the other textures into the auto folders they don't appear to work. My setup is this:

The model:

Models/cube/cube.md3

Base/diffuse texture:

Models/Cube/cube.png

The pbr maps:

Materials/normal(or roughness, metal, ao etc)/auto/cube (all the texture maps are just called cube)

And yet while the model shows up with the diffuse texture the rest don't work. What am I doing wrong?
hardcore_gamer
 
Joined: 14 Jan 2018

Re: Materials (PBR, Specular, Normal maps)

Postby HAL9000 » Sun May 06, 2018 5:01 pm

@hardcore_gamer

Here is Testcube with PBR materials I made for my project
https://www.dropbox.com/s/mn2i0nvwb9b00 ... M.rar?dl=0

Code: Select allExpand view
MAP Lights
Summon TESTCUBE3D

Or summon on any map with dynamic lights
Cheers!

Everything working as intended, Image:
Spoiler:
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 hardcore_gamer » Mon May 07, 2018 2:14 pm

I tried creating my own version of the file you uploaded using my own test cube and textures but it still doesn't work. Here is the file: https://ufile.io/ftm8q

There are also some things about your file that left me confused. For example, why do many of the text files have the word darkforces in them? And what are those dfm files?
hardcore_gamer
 
Joined: 14 Jan 2018

Re: Materials (PBR, Specular, Normal maps)

Postby HAL9000 » Tue May 08, 2018 7:32 am

Ok, I will check it out later,
Ignore dfm extension and other extensions, its just custom modeldef extension for my project
(dark forces model - dfm Dark forces actor - dfa etc....)

Update:
Ok Here is your Cube Actor, Fixed with working PBR (your textures).
I also created alternative pbr textures for it.
DOWNLOAD: https://www.dropbox.com/s/mt8ve6a4r8gon ... x.rar?dl=0

Also ,Normals on your MD3 models were Broken. Be sure to check your model normals & phong/curvature when exporting to MD3.
Phong/Curvature will affect how the texture will behave&look on model. I've fixed the model normal and set your curvature to default 22.5°

Normals/Curavture before & After
Spoiler:


Cheers!
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 hardcore_gamer » Tue May 08, 2018 3:28 pm

"Unable to find sprite lump "CUBEA" used by actor "cube":11001. Forgot to include required resources?"

I just get this error when I try to load the pk3 into gzdoom builder (I converted the files you uploaded to a pk3 so it could be loaded).

EDIT: I could still summon it with the "summon cube" command but it doesn't seem to work in gzdoom builder.
hardcore_gamer
 
Joined: 14 Jan 2018

Re: Materials (PBR, Specular, Normal maps)

Postby HAL9000 » Tue May 08, 2018 5:26 pm

It's not PK3 file, my archive was RAR with folders, I did not package it to PK3
Also Try to edit the cube actor to fit your requirements, I used my testcube actor's properties for this test.
I loaded it up with GZDoom 3.3.1 It works flawlessly

your original textures with fixed cube model
Spoiler:


new textures (so that you can see metalness/roughness fx)
Spoiler:
Last edited by HAL9000 on Tue May 08, 2018 5:34 pm, 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 hardcore_gamer » Tue May 08, 2018 5:29 pm

Yea I was just about to post to notify you I fixed the problem. I had to make some changes to the frame index definitions and then it worked. Thanks for your help mate, it's been useful :P
hardcore_gamer
 
Joined: 14 Jan 2018

Re: Materials (PBR, Specular, Normal maps)

Postby Nash » Fri Jun 15, 2018 3:14 pm

Hi, thought I'd drop a couple of good tutorials on PROPER normal map creation.

No kids, don't throw everything you got into CrazyBump or NormalMap-Online. Take some time to do PROPER normal maps and perhaps your visuals won't end up looking like asset flips.

http://www.opengl-tutorial.org/assets/i ... iniTut.jpg (save this image in case it goes offline)

https://www.katsbits.com/tutorials/text ... images.php

Now if you read the second tutorial, under the comments section, someone said it's possible to "generate" results with high-passing and what-not. That's cool too. Personally, I would recommend a workflow of first hand-painting your heightmaps and then converting that to a normal map to describe the huge cavities of the texture, and then using a generated (from diffuse) image to layer on top for micro detail (things like tiny bumps, surface irregularities etc). You'd typically paste the generated version on a separate layer and use the eraser tool to take out any parts that would collide with the main cavities from the hand-painted version.

BUT WAIT! Combining normal maps might not be as straight forward as you think it is. There's actually a trick to it. If you try to Google this stuff, there's a looooot of posts talking about maths and things like that, however I found the best way to do it that is the simplest and doesn't require math:

There's a pretty easy and completely correct (from mathematical point of view) method to combine two normal maps in PS.
Say, layer A is basic NM, layer B is detail NM. So to put detail from B over A you have to do the following steps:
1. Clone layer B - B2
2. Go to blue channel of B2 and fill it with neutral gray.
3. Set B2 layer blending to Overlay
4. Select original B and set it to Multiply blending mode.
5. Select red and green channels of B and fill them with pure white.
6. Put B and B2 into the new group, use group mask and opacity to adjust blending.

7 (Optional). If your target engine doesn't perform runtime NM normalization - you have to do in manually using for example Xnromal's plugin.
But actually everything always works fine even without normalization.


I have not covered best practices for generating specular maps yet. I'm still experimenting with this to find the best way. But you usually can get good results by taking a greyscale version of your diffuse and playing with the levels. I'll update this post once I've found a good specularity workflow.

Lastly, I intentionally haven't covered anything about PBR because the implementation in GZDoom is still incomplete (no reflection probes).
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Materials (PBR, Specular, Normal maps)

Postby Kappes Buur » Sat Jun 16, 2018 12:46 am

Nash wrote:.....
BUT WAIT! Combining normal maps might not be as straight forward as you think it is. There's actually a trick to it. If you try to Google this stuff, there's a looooot of posts talking about maths and things like that, however I found the best way to do it that is the simplest and doesn't require math:.....


Interesting.
Would you mind including images of the various steps?
User avatar
Kappes Buur
 
 
 
Joined: 17 Jul 2003
Location: British Columbia

Re: Materials (PBR, Specular, Normal maps)

Postby Indecom » Fri Jul 06, 2018 3:42 am

I've been away for a while for work, so I haven't kept up with doom. Is PBR a thing that works with sprites yet? lol
User avatar
Indecom
Check out QuakenDoom 2, my Q2 TC for Doom 2
 
Joined: 13 Jul 2009

Re: Materials (PBR, Specular, Normal maps)

Postby Graf Zahl » Tue Jul 10, 2018 4:01 am

No, considering that sprites do not get "real" dynamic lighting.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Materials (PBR, Specular, Normal maps)

Postby Nash » Tue Jul 10, 2018 4:24 am

Sprites getting "real" lighting (per pixel lighting) actually looks horrible, because the sprite billboard rotates depending on your view angle, which will cause the sprite's lighting to change as you circle strafe around it.

Imagine: you are in a dark room and there's an Imp standing in front of you. There is a red torch behind the imp. From where you are standing now, the imp is dark. Now if you reposition yourself so that now the red torch is in front of you, and the imp is behind it, suddenly the imp is brighter because the side of the imp billboard that's facing you is now rotated towards the red torch.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Materials (PBR, Specular, Normal maps)

Postby Indecom » Tue Jul 10, 2018 6:47 am

Oh I understand the stipulations of applying PBR to flat planes that rotate in a 3D space. The reason I want it is to apply it to the weapons in the player view, not so much to apply it to the sprites in the environment. This is a gorgeous effect that you can see put to great use in the game Amid Evil. I've already accomplished this with GZDoom but I had to trick the engine to make it work.
User avatar
Indecom
Check out QuakenDoom 2, my Q2 TC for Doom 2
 
Joined: 13 Jul 2009

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest