117 - Runtime Texture Groups

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 RectanglePackAllocator.

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.

Handling Texture Groups

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.

Monthly Finances

The finances for April 2021 were:

itemcost / earning
revenue+ $4.99
Stripe fees- $0.44
aws- $218.22
adobe substance- $19.90
GitHub- $9.00
adobe photoshop- $10.65
------
total- $253.22

Other Notes / Progress

  • Started working on a method in rectangle-pack to coalesce freed rectangles.

Next Journal Entry

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.


Well Wishes,

- CFN