Colour palette texture atlas for merged geometries
Description 📝
Generate a simple colour palette texture to replace multiple materials in merged geometries. With some simple UV mapping you map entire sections of a merged geometry to single pixels on a texture. This results in a single draw call for that geometry instead of n draw calls for n colours.
This could also be applied to instanced items to keep the number of unique materials to one. Although the benefits become less noticeable.
Suggested solution 💡
Based on the colours found in a merged geometry generate a small texture with a resolution of 1 x (unique colours) and UV map items to pixels in this texture. Additional pixel padding might be needed.
Alternative ⛕
No response
Additional context ☝️
This approach can be found in many 2D games where a larger texture atlas is used for many sprites. Resulting in fewer draw calls.
Example texture atlas:
Validations ✅
- [X] Read the docs.
- [X] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
This is a brilliant idea. I'm adding it to the next milestone!
This is a great idea, but would also make the library more complex. Streaming should already give us decent performance, even with bigger models. We'll leave this for now and keep this in mind as a resort to come back to if draw calls become an issue in the future