StarArawn / bevy_ecs_tilemap

A tilemap rendering crate for bevy which is more ECS friendly.
MIT License
902 stars 195 forks source link

Document pros/cons of `atlas` feature vs. default array system #294

Open bzm3r opened 1 year ago

bzm3r commented 1 year ago
    I enabled the `atlas` feature, and it seems to work now. However, I don't really know what the drawbacks or the major differences of enabling that feature are, since there is not really any documentation of that feature.

_Originally posted by @Floyden in https://github.com/StarArawn/bevy_ecs_tilemap/issues/289#issuecomment-1258036358_

rparrett commented 1 year ago

From StarArawn on Discord:

We have two rendering paths:

  1. Array textures
  2. Atlas textures Array textures are preferred on by default. These array textures support a lot of default GPU texture features natively. Atlas by comparison does not support things like non-point filtering, mipmaps, etc. Atlas is primarily still around because it's the only thing that works currently on webGL2. I've opened an issue as array textures should work: https://github.com/gfx-rs/wgpu/issues/3197

From a user perspective array texture does everything that atlas texture does and more. Atlases the user loads in are automatically converted into array textures. When the atlas feature is on the atlas is instead sent directly to the GPU.

A note about this section:

Atlas by comparison does not support things like ...

I think I'm correct to read this like "our texture atlas renderer does not support things like" rather than "it's not possible to support things like ... using texture atlases"

I think it might also be the case that the texture atlas feature can support more tiles in a single texture at least on certain hardware, but I am not sure about that.