These 3 objects do not accept texture replacements
- King of Worms
- Posts: 4755
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
These 3 objects do not accept texture replacements
The thing they have in common is that the texture replacement which is not working is a terrain texture placed usually at the top. It applies to all climate zones across the whole game. Is there anything we can do about it please?
Spoiler!
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- XJDHDR
- Posts: 258
- Joined: Thu Jan 10, 2019 5:15 pm
- Location: New Zealand
- Contact:
Re: These 3 objects do not accept texture replacements
I just tested this using a custom model that uses Runtime Materials to assign textures to it and it had the same problem. The part of the model which uses the grass terrain texture was still using the vanilla texture instead of DREAM's version:
I have attached the model I tested here:
KOW: Just want to confirm something. Does DREAM 2020-R3 have a modded copy of texture 302_2-0 in it?
Spoiler!
I have attached the model I tested here:
KOW: Just want to confirm something. Does DREAM 2020-R3 have a modded copy of texture 302_2-0 in it?
My DF Unity mods:
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
- King of Worms
- Posts: 4755
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: These 3 objects do not accept texture replacements
Hi! Thanks for looking at the issue.
Yes, DREAM has all the modded terrain tiles included in it, even the 302 etc
Problem with these objects is, that they are the only ones ingame, which are textured using terrain textures (archives 002, 102, 103 etc)
So the issues lies there somewhere, in the terrain shader or stuff like that, I have no idea precisely ofc
Yes, DREAM has all the modded terrain tiles included in it, even the 302 etc
Problem with these objects is, that they are the only ones ingame, which are textured using terrain textures (archives 002, 102, 103 etc)
So the issues lies there somewhere, in the terrain shader or stuff like that, I have no idea precisely ofc
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- XJDHDR
- Posts: 258
- Joined: Thu Jan 10, 2019 5:15 pm
- Location: New Zealand
- Contact:
Re: These 3 objects do not accept texture replacements
I just looked through the code for DFU as far as how textures are assigned to a model. The Runtime Materials script figures out which texture to assign by calling the GetMaterial method in MaterialReader.cs (I think the logic for assigning textures for vanilla model calls the same method). When it comes to DFMODs, the TryImportMaterial method is called which, in turn, uses the TryGetAsset method to ask Unity itself if any DFMOD contains a material with the given name.
I don't see any special logic for handling terrain textures. As far as I can tell, as long as you have a material named exactly "302_2-0" in your mod, the material assignment code should be able to find and use it.
I don't see any special logic for handling terrain textures. As far as I can tell, as long as you have a material named exactly "302_2-0" in your mod, the material assignment code should be able to find and use it.
My DF Unity mods:
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
- King of Worms
- Posts: 4755
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: These 3 objects do not accept texture replacements
Strange. Thing is, it does not assign the texture. Not only 302 but all the alternatives in different biomes :/ I think Interkarma should know whats up. I have no idea.. I also have a fever and chills
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- XJDHDR
- Posts: 258
- Joined: Thu Jan 10, 2019 5:15 pm
- Location: New Zealand
- Contact:
Re: These 3 objects do not accept texture replacements
Hope you get well soon.
There is one other thing I can think of. Before GetMaterial calls the TryImportMaterial method, it checks if the MaterialReader class has a copy of the material already stored in it's cache before trying to find it in the mods or data files. Maybe it's possible that the game put a copy of the vanilla texture in that cache somehow instead of the modded version? I'll see what I can do once I have some more time.
There is one other thing I can think of. Before GetMaterial calls the TryImportMaterial method, it checks if the MaterialReader class has a copy of the material already stored in it's cache before trying to find it in the mods or data files. Maybe it's possible that the game put a copy of the vanilla texture in that cache somehow instead of the modded version? I'll see what I can do once I have some more time.
My DF Unity mods:
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
Unofficial Block, Location and Model Fixes
Skip Intro Video
My other creations and essays:
https://xjdhdr.gitlab.io/
- King of Worms
- Posts: 4755
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: These 3 objects do not accept texture replacements
Thank you, Im really ill, the oldskool version before we had this c19 stuff, its kicking pretty strong :/
Anyway, thanks for looking into it, you might be up on something with that cache
Anyway, thanks for looking into it, you might be up on something with that cache
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: These 3 objects do not accept texture replacements
I've had a look at this one. Summary of problem is that replacement terrain textures are loaded early and into a texture array. The individual terrain texture replacements aren't left available for standalone objects like these, so they end up with the default texture. Only the part of these models using a terrain texture is affected, the other parts work as expected.
I don't have a solution right now. I'll try to find a low-impact way of solving that doesn't break anything else.
I don't have a solution right now. I'll try to find a low-impact way of solving that doesn't break anything else.
- King of Worms
- Posts: 4755
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: These 3 objects do not accept texture replacements
Hi Interkarma, thanks for looking into the issue. Fingers crossed it gets solved at some point, yet I understand its not a high priority atm
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Kab the Bird Ranger
- Posts: 123
- Joined: Tue Feb 23, 2021 12:30 am
Re: These 3 objects do not accept texture replacements
Not the only issue we have with that array for terrain textures: https://github.com/Interkarma/daggerfal ... ssues/2310