PBR materials on MD3 models?

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.

PBR materials on MD3 models?

Postby PixelWAD » Sun Aug 19, 2018 6:09 am

Is it possible to apply PBR materials definition (via gldefs?) for 3D models?

I tried to follow the same steps as for defining wall textures as PBR. Those do work, but if I replace the path to the one for my MD3 model, it does not seem to have any effect in the game.

i have also tried to move them manually into textures/specular/normal and applying them to TEXTURES.txt so the engine can recognize them, but it does not work.

So either I'm doing something wrong, or MD3 PBR is not supported yet.
PixelWAD
 
Joined: 11 Jun 2018

Re: PBR materials on MD3 models?

Postby R4L » Mon Aug 20, 2018 8:27 am

It's supported. HAL 9000 has made weapons with PBR.
User avatar
R4L
Ordinary Vanity
 
Joined: 03 Mar 2017
Discord: R4L#4655
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: PBR materials on MD3 models?

Postby PixelWAD » Mon Aug 20, 2018 10:18 am

Can you link me to his files so i van have a look?

Using the same way as for wall textures didn't work for me.
PixelWAD
 
Joined: 11 Jun 2018

Re: PBR materials on MD3 models?

Postby HAL9000 » Mon Aug 20, 2018 1:10 pm

PixelWAD wrote:Can you link me to his files so i van have a look?
Using the same way as for wall textures didn't work for me.


Here you go, you can use this for testing purposes: Summon WeaponSSG
https://www.dropbox.com/s/d73rqwb816bq0 ... E.rar?dl=0
You can also combine PBR with Hardware shaders

Gif from another discussion
Spoiler:
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: PBR materials on MD3 models?

Postby PixelWAD » Mon Aug 20, 2018 2:40 pm

Thanks. Our gldef was nearly the same, with the difference that you point out full texture model path, so did I this time:

Code: Select allExpand view
// RPG FPP PBR
material texture "models/firstperson/2544_rpg_d.png"
{
 normal            models/firstperson/2544_rpg_n.png
 specular          models/firstperson/2544_rpg_s.png
 specularlevel     8 // default 0.7
 glossiness        16 // default 8
}

// FPP DUKE HAND PBR
material texture "models/firstperson/duke_hand_d.png"
{
 normal            models/firstperson/duke_hand_n.png
 specular          models/firstperson/duke_hand_s.png
 specularlevel     8 // default 0.7
 glossiness        16 // default 8
}


However it does not work. Is it because I'm only using _N and _S as extra pbr textures? You have a full set.
PixelWAD
 
Joined: 11 Jun 2018

Re: PBR materials on MD3 models?

Postby PixelWAD » Fri Aug 31, 2018 8:57 am

A week passed by and i still want able to get it to work. My walls and flats work with pbr, but not a single md3. Sample above does work
PixelWAD
 
Joined: 11 Jun 2018

Re: PBR materials on MD3 models?

Postby Enjay » Fri Aug 31, 2018 1:45 pm

Dunno if it makes any difference but have you tried putting quote marks around all of your file paths, not just the material texture one?

[edit] As an aside, I assume it's because all the images are big and all loading at the same time but with the demo file, when I type "give weaponssg" at the console, the game freezes for something like 15 seconds until the weapon appears and the game then plays normally from that point on. And that's on an i7 machine with an SSD and a 1080. [/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PBR materials on MD3 models?

Postby PixelWAD » Fri Aug 31, 2018 2:17 pm

My game freezes for a little when trying the sample above as well, but my own sample just doesn't work with pbr. I'll try your suggestion but i think i have already tried that
PixelWAD
 
Joined: 11 Jun 2018

Re: PBR materials on MD3 models?

Postby HAL9000 » Tue Sep 04, 2018 3:11 pm

Enjay wrote:Dunno if it makes any difference but have you tried putting quote marks around all of your file paths, not just the material texture one?

[edit] As an aside, I assume it's because all the images are big and all loading at the same time but with the demo file, when I type "give weaponssg" at the console, the game freezes for something like 15 seconds until the weapon appears and the game then plays normally from that point on. And that's on an i7 machine with an SSD and a 1080. [/edit]


Yeah,original textures are big, it will take time to load them, try to scale them down to idk 512, 256 or less...
This sample was made just for test purposes
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: PBR materials on MD3 models?

Postby HAL9000 » Tue Sep 04, 2018 3:16 pm

PixelWAD wrote:A week passed by and i still want able to get it to work. My walls and flats work with pbr, but not a single md3. Sample above does work


Just try to use mymodeldef and modify it for your models.

Also try this, edit your textures with mspaint(yes mspaint) and save it
Try now.
Last edited by HAL9000 on Tue Sep 04, 2018 3:18 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: PBR materials on MD3 models?

Postby Enjay » Tue Sep 04, 2018 3:17 pm

I actually tried scaling them right down to 128x128 shortly after I posted. They loaded instantly but, obviously, the visuals took a big hit. However, the result wasn't as bad looking as I expected.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PBR materials on MD3 models?

Postby HAL9000 » Tue Sep 04, 2018 3:20 pm

Enjay wrote:I actually tried scaling them right down to 128x128 shortly after I posted. They loaded instantly but, obviously, the visuals took a big hit. However, the result wasn't as bad looking as I expected.


Yes, they will look bad if scaled down manually.
To make them look good, I would have to export/render them from substance in 128x128 (or any other smaller res.)
Original substance was 4k/texture iirc, and it was not meant to be used in GZD ;)
https://sketchfab.com/models/2fec5ea4c7 ... 4a0dfc27d4
Last edited by HAL9000 on Tue Sep 04, 2018 3:26 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: PBR materials on MD3 models?

Postby Enjay » Tue Sep 04, 2018 3:24 pm

Understood. I knew they wouldn't look great scaled down. It was more of an exercise in checking the loading time and it made a difference (quarter of a minute to effectively instant is a big improvement). I guess if someone was using something like this in an actual mod, they would have to find an acceptable compromise between load time and appearance.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest