#render #vertex #batch #bevy #graphics

hephae-atlas

Hephae's texture atlas rendering and asset module

1 unstable release

new 0.6.0 Feb 15, 2025
0.5.0 Feb 2, 2025
0.4.0 Jan 6, 2025
0.3.0 Dec 26, 2024
0.2.2 Dec 17, 2024

#356 in Rendering

Download history 137/week @ 2024-12-10 234/week @ 2024-12-17 133/week @ 2024-12-24 78/week @ 2024-12-31 52/week @ 2025-01-07 1/week @ 2025-01-14 105/week @ 2025-01-28 11/week @ 2025-02-04 263/week @ 2025-02-11

379 downloads per month
Used in hephae

MIT/Apache

32KB
483 lines

hephae-atlas

Provides texture atlas functionality.

A texture atlas contains atlas pages, i.e. lists of textures packed into one large texture in order to reduce the amount of bind groups necessary to hold the information passed to shaders. This means integrating a texture atlas into Vertex rendering will significantly increase batching potential, leading to fewer GPU render calls.

This module provides the TextureAtlas type, which also derives Asset and has an associated asset loader with it. Refer to TextureAtlasFile for the specific format of .atlas files.

This module also provides AtlasEntry and AtlasIndex components; the former being the atlas lookup key, and the latter being the cached sprite index. The dedicated update_atlas_index system listens to changes/additions to texture atlas assets and updates the AtlasIndex of entities accordingly.

Ideally, you'd want to associate each atlas pages with a BindGroup, define a texture and sampler layout in the specialized pipeline, somehow store a reference to this bind group into the batch entities, and finally set the render pass' bind group to the atlas page bind group accordingly with the layout you defined earlier.

See the examples/sprite.rs for a full example.

Dependencies

~35–66MB
~1M SLoC