Page 1 of 2

PBR Materials for classic textures

Posted: Wed May 15, 2019 7:25 am
by SubPixel-Chris
Hey guys, thanks for checking out my thread.

So I'm working (slowly) on putting together a material mod for Daggerfall Unity that incorporates the PBR (physically based rendering) material workflow utilizing slightly modified versions of the classic DF textures. To give you an idea of the kind of effect that I'm hoping to have, check out these test videos that I put together showcasing similar effects using the Doom engine:

https://www.youtube.com/watch?v=5EzXWjVcXVU

I love the combination of low res textures and advanced lighting, they work incredibly well with low poly models.

However I'm new to DFU modding, and I have a day job so progress will be fairly slow.

One of the things I'm having some issues with is the MetallicGloss textures, I'm not finding much documentation on how to implement them and I'm definitely not getting normal results. Currently I'm using the RGB channels for Gloss, and the Alpha channel for Metallic. Is this not correct?

Here's a look at what I'm getting so far:
Image

The nails on the floorboard should be shining like metal, same with the metallic bits on the door, yet everything is uniformly smooth shaded. Is it necessary to create a material definition in xml for these to function properly? One thing I've noticed is that the MG texture does work if I remove the normal map. Is this a bug?

Image

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 9:09 am
by King of Worms
I like it

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 12:07 pm
by Nystul
I did this in my realtime reflections mod, see this post: viewtopic.php?f=27&t=122&start=50#p3102

regarding the metallic gloss map: metallic is rgb, glossiness is alpha - check out the metallic gloss maps from my mod (inside the mod zip there is a RealtimeReflections_textures.zip file containing the metallic gloss maps)

here are some example screenshot showing the metallic gloss maps in action:

Image

Image

Image

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 1:26 pm
by MasonFace
So I'm working (slowly) on putting together a material mod for Daggerfall Unity that incorporates the PBR (physically based rendering) material workflow utilizing slightly modified versions of the classic DF textures.
Looks great! I also love the look of PBR shaders coupled with low resolution textures. Something about the anachronism of the retro look with advanced lighting just really pops.

I'm also working on PBR materials for my Pure Vanilla Extract MOD, but I'm starting from my AI upscaled resolution (4x the resolution of DF).


You can download a mini-mod version of this that has just the Privateer's Hold textures done here. (Make sure you enable bilinear or trilinear filtering).

Image

Anyway, like you, I'm just chipping away at this as I have time (maybe a few hours per week?) so progress is slow and the library of DF textures is massive!

Would you be interested in joining forces? We could make much faster progress on building PBR materials at 4x resolution together and easily downscale the results to achieve the aesthetic you're looking for.
No pressure. No obligation. Of course you'd be credited as an artist in the PVE mod.

One of the things I'm having some issues with is the MetallicGloss textures, I'm not finding much documentation on how to implement them and I'm definitely not getting normal results.
Yeah, the documentation on this is pretty spotty. I think they changed the workflow sometime around Unity 2018-ish which made it more complicated. But as Nystul said, you store the "Metallic" data in the R channel, and "Smoothness" data in alpha. Source: https://docs.unity3d.com/Manual/Standar ... allic.html
Is it necessary to create a material definition in xml for these to function properly?
I don't think you have to include the XML file if you don't need to adjust any parameters.

Another way is to use Unity with the Daggerfall Tools for Unity package installed. From there, just create a new material with the same name as the original asset (for example: "020_1-0"), load in the albedo, normal, metallic, occlusion, and height maps if you want them. Then select all these materials and package them as a MOD. (Excellent tutorial by LypyL here: viewtopic.php?f=22&t=277#p2380 )

The other benefit of doing it within Unity is that you can setup a simple quad and light and test how it will look without having to load DFU and have to search for that material somewhere in the game world. This can save you a lot of time tweaking the individual maps and their parameters, especially while you get the hang of Unity's (rather odd) Metallic workflow.

Regardless of whether or not you want to work together on this, good luck and have fun!

P.S.: Feel free to PM me if you have any other questions.

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 2:39 pm
by Nystul
btw, feel free to reuse or modify the metallic gloss maps from my mod if this helps ;)

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 6:19 pm
by SubPixel-Chris
Thanks for the replies guys. The one problem I'm seeing so far is that there's no evidence of combined metallicgloss and normal actually working together. The realtime reflections look great, however the materials are still flat. Do these two things just not work with eachother? Does the engine stop injecting textures once it's found the normal? Am I going to have to modify the game's source code to allow this? lol

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 7:46 pm
by MasonFace
One thing I've noticed is that the MG texture does work if I remove the normal map. Is this a bug?
There could be an issue with asset injection using loose files, maybe?
Currently I'm using the RGB channels for Gloss, and the Alpha channel for Metallic.
According to how you described your metallic map creation, I wouldn't have expected it to look right in either picture. I can't explain why the metallic map appears to be functioning when the normal map is removed, though. :?

What version of DFU are you running?

Do you mind sharing your files? I'm curious if I can replicate your results. Just need the floor texture with its accompanying normal and metallic map.
Am I going to have to modify the game's source code to allow this?
I promise you won't have to modify the source code or anything that drastic! :)

If you take the route I suggested and build the PBR materials within Daggerfall Tools for Unity, I guarantee it will work correctly (many of my PVE materials, as well as KoW's DREAM materials use Albedo, Normal, Metallic, Height, Occlusion, and secondary normals at the same time with no issue.

I do understand not wanting to go through all that if you've never used Unity before, though. It can be a bit daunting at first. For that reason, the loose file asset injection method is quite alluring.

Re: PBR Materials for classic textures

Posted: Wed May 15, 2019 10:34 pm
by King of Worms
Agreed with MasonFace.
Using the unity for this is ideal.
And its not THAT hard.
I can help you with that.
If I was able to learn it, everybody will.

Re: PBR Materials for classic textures

Posted: Thu May 16, 2019 6:34 am
by SubPixel-Chris
Oh Unity is not a problem for me. I'm a game developer full time so I've plenty of experience.

I'm honestly contemplating creating custom materials from the ground up for this mod, since I'm not really liking the oversaturation of the classic textures. I think what I'll likely do is use something like quixel suite, or quixel mixer to create custom PBR materials in low resolution that match the design of the classic textures but more grounded in reality.

Kind of like these:

https://www.youtube.com/watch?v=3HY5h7bGd6A

Re: PBR Materials for classic textures

Posted: Thu May 16, 2019 10:26 am
by King of Worms
If you heading for a total texture conversion on all the textures (like I did on my mod) I recomend starting with a texture categorization, and exclusion of unused textures.

My folder looked like this:

Dungeons - mines and caves (2 of 8 used)
Dungeons main quest (16 of 17 used)
Dungeons (22 of 24 used)
Buildings (8)
- castle and pallace 15
- city and village 39
- farm 12
- mages guild 11
- manor 12
- merchant 12
- tavern 12
- temple 12

City wallls (8)
Fences (8)
Marbles (4)
Roofs (8)
Terrain (7 of 12 used)
Paintings (4)
Ruins (8)


Number is the amount of sets .)

I can help with that, I still have that god damned folder.
Excluding the unused textures is a must before u start.
I can as well pack it and send it to you.. the folder structure is very handy!

PS: If you happen to create a now weather system (ideally open for modding) you would make us happy :lol: :lol: :lol:
And flying birds ;) ;) ;)
And..