Currently, each loaded texture is managed separately into its own GPU texture object, which means there is a lot of GPU state change required to render the whole UI. If multiple textures can be combined into one, each element could draw from different parts of the "big" texture, and the GUI could be drawn with no GPU state change.
This will require adapting certain parts of the code that rely on the UV coordinate wrapping, such as the backdrop. Tiled textures will need to be manually repeated into separate quads. This will mean drawing more vertices. The performance hit caused by this should be compensatd if the vertices can be stored in a vertex cache.
Since this may or may not bring performance benefits, there should be a way for the user to toggle this on or off.
The API for loading materials should allow the user to specify if a material should be loaded as an isolated texture, or if it is allowed to be baked into an atlas.
There should be support for multiple atlases, so that various texture categories (e.g., UI vs world textures) can be grouped logically together to minimize state changes, for cases where not all textures fit onto a single atlas.
Atlases should be resilient to filling up, i.e., the user should not have to worry about selecting the right atlas texture etc; this should be handled under the hood.
Currently, each loaded texture is managed separately into its own GPU texture object, which means there is a lot of GPU state change required to render the whole UI. If multiple textures can be combined into one, each element could draw from different parts of the "big" texture, and the GUI could be drawn with no GPU state change.
This will require adapting certain parts of the code that rely on the UV coordinate wrapping, such as the backdrop. Tiled textures will need to be manually repeated into separate quads. This will mean drawing more vertices. The performance hit caused by this should be compensatd if the vertices can be stored in a vertex cache.
Since this may or may not bring performance benefits, there should be a way for the user to toggle this on or off.
The API for loading materials should allow the user to specify if a material should be loaded as an isolated texture, or if it is allowed to be baked into an atlas.
There should be support for multiple atlases, so that various texture categories (e.g., UI vs world textures) can be grouped logically together to minimize state changes, for cases where not all textures fit onto a single atlas.
Atlases should be resilient to filling up, i.e., the user should not have to worry about selecting the right atlas texture etc; this should be handled under the hood.