Modding Tutorials: Asset-Injection

Discuss modding questions and implementation details.
Post Reply
User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Modding Tutorials: Asset-Injection

Post by pango »

King of Worms wrote: Sat Jan 26, 2019 5:39 pm EDIT: And btw, what is that effect? Is that a bug? Looks like a water...
Never saw this... But I hope I will, it's cool :)
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

What I'm gathering is that Heightmap and Occlusion work, but only when packaged as a mod, not loose files. This makes sense as the materials' meta data would be built and contained within the mod, while loose files would have to populate these textures into materials at startup which hasn't been incorporated yet.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Modding Tutorials: Asset-Injection

Post by King of Worms »

Oh ok, sry for confusion than, this makes sense

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Modding Tutorials: Asset-Injection

Post by TheLacus »

I made a PR to add support for HeightMaps for both mods and loose files. Not sure why is already working for KoW, maybe it's already being used by one of the included standard assets or something changed with new Unity version. Anyway, it is now going to work as intended for sure.

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

I'm getting odd results with my metallic textures when used in DFU compared to within Unity.

Is the "Standard (Roughness setup)" the format that DFU expects the Metallic maps to be in? If so, I can't find any documentation on how to work with it. Right now, I'm using the regular Standard shader where my metallic texture has the metallic information stored on the red channel, and smoothness on the alpha channel, but what's rendered in DFU looks like isn't reading in the alpha information at all. What I mean is that the whole texture has uniform smoothness/glossiness, but my metallic texture has a wide range of alpha values, so the the resulting effect should have some parts reflect more light than others but the whole texture is uniformly shiny.

I've tried using "_Metallic" and "_MetallicGloss" suffix at the end of the Metallic texture names, but neither change the outcome.

Not sure how well I can capture what I mean with pictures, but I can try if you think it would communicate.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Modding Tutorials: Asset-Injection

Post by King of Worms »

This is how it works on my setup... but I have absolutely no idea how Quasifex created the metallic map and no idea why it works, because its just black :D
But it works... Im not sure its good idea to use unsupported Unity version (if u still using 2019) - it might render your work obsolete. (or will my work be obsolete if we move towards 2019 version, no idea)

Anyway:
Here u can download that metalic map
https://ufile.io/pchr9

and it looks like this, glass reflections on the emission map:
01.jpg
01.jpg (243.48 KiB) Viewed 5151 times

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

Im not sure its good idea to use unsupported Unity version (if u still using 2019)
Where is it stated that Unity 2019 isn't supported? I've been looking for documentation and all I can find is: Minimum Unity3D version - 2018.2.11f1 on the GIT page for Daggerfall-Unity. Am I overlooking it somewhere else?

Regardless, I've opened my project in the oldest version of Unity that I still have installed which is Unity 2018.2.1f1 Personal.

It has 3 Standard shaders:
  • Standard
  • Standard (Roughness setup)
  • Standard (Specular setup)
When I use "Standard" shader in Unity 2018, I get the expected result (same as Unity 2019) when I use my Metallic map (smoothness in the alpha channel). This is consistent with how it appears that Quasifex setup his material. However, when the same _Metallic texture is injected into DFU, it looks similar to "Standard" shader but without a smoothness texture assigned. This leads me to believe that the metallic maps are working correctly as loose files. Also, can you clarify they proper file suffix to be used ( _Metallic or _MetallicGloss)? Neither worked for me.

Also, I can confirm that the DREAM mod heightmaps and metallic maps are working correctly in DFU, which leads me to believe that my previous assertion is true: loose files for heightmaps are not supported, but when integrated into a mod, they do work (all the meta data is packed in the mod). If correct, this implies that modders could use any shader they want since the material is contained in the mod file, which explains how some of the materials are using "Standard (Roughness setup)" and still work properly.

As an aside, the "Standard (Roughness setup)" has been deprecated in Unity 2019 because it is inefficient (the metallic and roughness are stored as separate textures instead of two channels in the same texture).

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Modding Tutorials: Asset-Injection

Post by King of Worms »

Maybe I understood it wrong, but I thought the versions too ahead of the 2018.2 can cause problems. I used latest version one time and it game me problems, but that might be caused by something else - Im a noob.

To your question... judging by the "realtime reflections" mod, the files should be like this I believe:
002_0-0_MetallicGloss.png
002_0-0_MetallicGloss.png (216 Bytes) Viewed 5130 times
I hope I will not have to remake all the roughness shaders. I dont enjoy tedious work like that. Its just a work. Did way too much work already on my mod. The kind of work a monkey can do, but theres no monkey around, so you do it... and you glad you survived it and its gone ;)

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: Modding Tutorials: Asset-Injection

Post by MasonFace »

Maybe I understood it wrong, but I thought the versions too ahead of the 2018.2 can cause problems. I used latest version one time and it game me problems
That may have happened from Unity 5 to Unity 2018. I think Unity deprecated a lot of old methods which would cause problems if you try to open a project from Unity 5 inside of Unity 2018. I don't think the jump to 2019 has been that drastic.
I hope I will not have to remake all the roughness shaders. I dont enjoy tedious work like that.
Well again, if my theory is correct about mods having the materials and meta data packaged, then you're safe going the roughness texture route and shouldn't have to do any rework. Like I said, it's less efficient using the roughness setup, but I don't know by how much - it could be negligible. Also, there may be a tool to convert metallic/roughness maps into a singular upgraded metallic map (where the smoothness is in the alpha). If not, I'm sure we could come up with a G'MIC routine to do it in a batch. Since smoothness is just the inverse of roughness, we'd just invert the roughness texture, then send its RGB data to be the alpha layer of your metallic texture. Shouldn't be too hard.
To your question... judging by the "realtime reflections" mod, the files should be like this I believe:
I took a look at several of Nystal's _MetallicGloss textures. It looks like he's doing it the "Standard" shader way with the smoothness on the alpha channel and it works as expected in Unity 2019 and looks right in DFU. Why his works in DFU and mine doesn't, I still don't understand.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Modding Tutorials: Asset-Injection

Post by King of Worms »

Finally re-discovered this thread:)
I will place the PM I wrote to Lacus, so it does not get lost:

---------------------------------------------------------------------

Im experimenting with the map replacement. The main files work nicely!

But Ive found some minor images which do not work yet (the size is not right - way too big after upscale)

TRAV0I03.IMG - Find/Im at button

TRAVAI05.IMG - DOWN arrow
TRAVBI05.IMG - UP arrow
TRAVCI05.IMG - RIGHT arrow
TRAVDI05.IMG - LEFT arrow

Rest is working nicely, main map and region maps and other buttons, great job!!

Only thing Im not happy with now is that the red flashing regions which show where you are located, are still 320*200 and it looks bad. Is it possible to have any access to the file which is responsible for this?
Its described here in a last post, with a screenshot. THANK YOU!!

viewtopic.php?f=22&t=1804&start=30

Post Reply