I thought you were still using the provider, I mean wasn't it added to DFU for your needs? I reported the issues I saw but when you removed that code I though it was because it had now moved into DFU core. Either way, I've not dived into what it is or how it works so can't be much help advising here - listen to TheLacus instead
@Blessed, that code you posted seems to completely ignore the standard DFU code for loading images, and I don't think it should be provided to other modders as the way to do things.
How does Asset Injection work?
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: How does Asset Injection work?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- Daniel87
- Posts: 391
- Joined: Thu Nov 28, 2019 6:25 pm
Re: How does Asset Injection work?
Yes, I will have a look at the MaterialProvider tomorrow again. Not sure if the MaterialProvider alone will be of help for this issue or if I also need to mod the MaterialReader.csHazelnut wrote: ↑Thu May 27, 2021 6:00 pm I thought you were still using the provider, I mean wasn't it added to DFU for your needs? I reported the issues I saw but when you removed that code I though it was because it had now moved into DFU core. Either way, I've not dived into what it is or how it works so can't be much help advising here - listen to TheLacus instead
@Blessed, that code you posted seems to completely ignore the standard DFU code for loading images, and I don't think it should be provided to other modders as the way to do things.
Code: Select all
Material tileMaterial = DaggerfallUnity.Instance.MaterialReader.GetTerrainTextureArrayMaterial(GetGroundArchive(terrainMaterialData.WorldClimate));
In Julianos we Trust.
-
- Posts: 1409
- Joined: Mon Aug 12, 2019 4:32 pm
- Contact:
Re: How does Asset Injection work?
Roger, thanks for the feedback. Was a quick code I grabbed to get work done fast.@Blessed, that code you posted seems to completely ignore the standard DFU code for loading images, and I don't think it should be provided to other modders as the way to do things.
My Daggerfall Mod Github: l3lessed DFU Mod Github
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: How does Asset Injection work?
Yes, this is correct. TextureReplacement doesn't have any knowledge of Daggerfall terrains, it only provides a texture2Darray with the required depth. This is intended and shouldn't be changed.Daniel87 wrote: ↑Thu May 27, 2021 6:09 pm Not sure if the MaterialProvider alone will be of help for this issue or if I also need to mod the MaterialReader.csI believe in the GetTerrainTextureArrayMaterial function, the material is created and the depth of the texture2darray is set.Code: Select all
Material tileMaterial = DaggerfallUnity.Instance.MaterialReader.GetTerrainTextureArrayMaterial(GetGroundArchive(terrainMaterialData.WorldClimate));
MaterialReader generates texture arrays (also using TextureReplacement) specifically for the terrain and expects a depth of 56 layers. This value is enforced for both prebuilt arrays (like what you are providing) and runtime genrated ones (i.e. from individual textures from KoW mod).
You should be able to retrieve your texture array asset directly from TextureReplacement (or even with Mod.GetAsset()), at least for now. Proper support for textures from other mods would be trickier. For example, what happens if the other mod doesn't have all required textures? Maybe is better to specifically get textures from a list of known compatible mods.