Stack/06 texture cache#373
Conversation
Caches TextureArray composition keyed by TextureArrayTypes so only texture creation happens at runtime; SaveGlobalCache now takes the nested per-type dictionary.
| // The target array is a pure function of (material group, texture format): registration is | ||
| // deterministic and independent of the order in which worlds, VOBs and items are processed. | ||
| // Dual-use textures get registered once per referencing side (Water and solid). | ||
| if (group == MaterialGroup.Water) |
There was a problem hiding this comment.
I don't think this separate IF is needed. Just put it all together:
IF (Water.contains() || Opaque.Contains() || Transparent.Contains()
Helps better readability.
There was a problem hiding this comment.
now that i think about it the whole if/else if logic is not robust enough, this only checks if a texture with the water material is used in water and other caches. dual-textures can only be in water and either opaque or transparent because of how they are processed later in the function
i need to take a look at this
| { | ||
| TextureArrayInformation.Add(animationTexture.Key, | ||
| new StaticCacheService.TextureInfo(textureArrayType, Math.Max(animationTexture.Value.Width, animationTexture.Value.Height), 0)); | ||
| // Animation frames must occupy the array slices directly after their base texture. |
There was a problem hiding this comment.
Please add more words from your end why this is needed as comment in code. I currently don't understand.
There was a problem hiding this comment.
this comment is to be taken in context with the one from the foreach loop
Summary
Refactor the texture cache to allow a material to be in different texture cache arrays (OWODWAT_A0 is used by river materials and by the Old Camp cauldron's soup surface)
How to test
Load into world.zen and check river in front of old camp