mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 06:44:38 +01:00
https
@@ -13,8 +13,8 @@ Pure array textures were quickly dismissed, because those too are limited to onl
|
||||
Instead, the implementation uses a collection of texture atlases. Texture atlases are created for a specific power-of-two texture size like 32x32, 64x64 and so on. If a new texture comes in and there is no suitable texture atlas with any free spots left, then a new atlas is created and added to the array texture of atlases. All of the atlases have the same dimensions (required for texture arrays), but the images within do not. Each texture image is assigned a single square region in the appropriate atlas. The square regions are always equal to the power-of-two size that the atlas was created for. The idea of having different atlases for different power-of-two size textures is to ensure tight packing to waste as little VRAM as possible.
|
||||
|
||||
Here are two examples of what atlases look like in the array texture (from RenderDoc):
|
||||
* [32x32](http://i.imgur.com/Bl9d5Ly.png)
|
||||
* [64x64](http://i.imgur.com/eTxh3xA.png)
|
||||
* [32x32](https://i.imgur.com/Bl9d5Ly.png)
|
||||
* [64x64](https://i.imgur.com/eTxh3xA.png)
|
||||
|
||||
Once a texture is in an atlas like that, the draw command only needs 2 parameters to access the texture: the index of the atlas and the top-left to bottom-right coordinates within the atlas. The bottom-right coordinates are based on the actual size of the image and not the entire power-of-two block. As many atlases are created as needed when new textures come in, and the system can scale up to 2048 atlases simultaneously on most implementations.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user