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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
PixelWAD
Posts: 188
Joined: Sun Jun 10, 2018 7:01 pm

PBR materials on MD3 models?

Post by PixelWAD »

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.
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: PBR materials on MD3 models?

Post by R4L »

It's supported. HAL 9000 has made weapons with PBR.
PixelWAD
Posts: 188
Joined: Sun Jun 10, 2018 7:01 pm

Re: PBR materials on MD3 models?

Post by PixelWAD »

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.
User avatar
HAL9000
Posts: 266
Joined: Fri Mar 16, 2018 7:44 am
Contact:

Re: PBR materials on MD3 models?

Post by HAL9000 »

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:
PixelWAD
Posts: 188
Joined: Sun Jun 10, 2018 7:01 pm

Re: PBR materials on MD3 models?

Post by PixelWAD »

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 all

// 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
Posts: 188
Joined: Sun Jun 10, 2018 7:01 pm

Re: PBR materials on MD3 models?

Post by PixelWAD »

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
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PBR materials on MD3 models?

Post by Enjay »

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]
PixelWAD
Posts: 188
Joined: Sun Jun 10, 2018 7:01 pm

Re: PBR materials on MD3 models?

Post by PixelWAD »

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
User avatar
HAL9000
Posts: 266
Joined: Fri Mar 16, 2018 7:44 am
Contact:

Re: PBR materials on MD3 models?

Post by HAL9000 »

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
Posts: 266
Joined: Fri Mar 16, 2018 7:44 am
Contact:

Re: PBR materials on MD3 models?

Post by HAL9000 »

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
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PBR materials on MD3 models?

Post by Enjay »

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
HAL9000
Posts: 266
Joined: Fri Mar 16, 2018 7:44 am
Contact:

Re: PBR materials on MD3 models?

Post by HAL9000 »

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
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: PBR materials on MD3 models?

Post by Enjay »

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.
Post Reply

Return to “Scripting”