Closed liuxi150 closed 1 month ago
The changes in loader-impl.ts
adjust the calculation of texture indexes in the TextureManager
class. Specifically, the addTexture
and getTexture
methods now use a modified index when the isBaseColor
flag is true, ensuring that the textures are uniquely and correctly identified within the manager.
File | Change Summary |
---|---|
plugin-packages/.../gltf/loader-impl.ts |
Updated TextureManager 's addTexture and getTexture methods to include (matIndex + 1) in the index calculation when isBaseColor is true. |
sequenceDiagram
participant User
participant TextureManager
User->>TextureManager: call addTexture(matIndex, texIndex, tex, isBaseColor)
TextureManager->>TextureManager: calculate index
TextureManager-->>User: add texture
User->>TextureManager: call getTexture(matIndex, texIndex, isBaseColor)
TextureManager->>TextureManager: calculate index
TextureManager-->>User: return texture
In the code where textures align,
A tweak to keep them in line,
With base color's embrace,
Indexes find their place,
Now textures shine, divine!
🖼️✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit