May 2, 2021
The runtime texture atlas allocator saga continues.
Towards the beginning of the week I added a method to rectangle-pack to allow the freeing of placed rectangles.
This gives me the ability to de-allocate textures by removing their corresponding rectangle
within the engine's
Over time I plan to add more allocators to support different kinds of allocation strategies, such as allocating an atlas that I know will contain subtextures that are all the exact same size.
For now, however, the
RectanglePackAllocator is the only implemented allocator.
After this I started working one of the more complex parts of the runtime texture allocation process, handling grouped textures.
Certain textures need to always be placed in the same texture atlas as other textures. For example, a base color texture for a physically-based texture needs to always be in the same atlas as the corresponding normal map.
To achieve this, I'm tracking the atlas that the first member of a group gets placed in.
When subsequent members of a texture group are being placed, they all get placed into that same atlas.
If we try to place a group member and it can't fit, we move all of the members of the group to a different atlas and then place the new texture into that atlas.
In this way, we ensure that textures in the same group are always in the same atlas regardless of whether or not we download and buffer them at the same time and regardless of the order that we buffer them.
The finances for April 2021 were:
|item||cost / earning|
|Stripe fees||- $0.44|
|adobe substance||- $19.90|
|adobe photoshop||- $10.65|
- Started working on a method in rectangle-pack to coalesce freed rectangles.
I'm going to continue working on the runtime texture allocation. Things are moving a little slowly since I've been busy writing other software in order to bring in more money in the near term, but day by day I am getting better at balancing all of my efforts.