Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally provide more versatile tile-map functionality #6

Open
mattdm opened this issue Sep 21, 2023 · 4 comments
Open

optionally provide more versatile tile-map functionality #6

mattdm opened this issue Sep 21, 2023 · 4 comments

Comments

@mattdm
Copy link
Contributor

mattdm commented Sep 21, 2023

I see in

// see https://github.com/ethereumdegen/bevy_terrain/blob/main/assets/shaders/advanced.wgsl
the link to bevy_terrain's advanced shader, which uses a function to find the individual tile texture. The RGBA hack this plugin uses currently is very clever, but it'd be nice to have some more versatile options:

  • N-bit grayscale image indicating tile number in a larger atlas
  • N-bit RGBA but use R and B for tile number and G and A for alpha respectively
  • Multiple ordered layers, with alpha channel the tiles in the atlas in "higher" layers (so the lower ones show through)
  • For any of the above, plus the current RGBA blend approach, a seeded randomization (to pick, say, one of 16 variant grass tiles).
  • automatic selection of edge/corner transition tiles
  • load tiled-format maps (as bevy_tiled can in 2D (example: https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/examples/tiled.rs)

What do you think?

@mattdm
Copy link
Contributor Author

mattdm commented Sep 24, 2023

If you're interested, this looks like something I could experiment with....

@mattdm
Copy link
Contributor Author

mattdm commented Sep 27, 2023

Oh, here's another one, keeping the "splat map" idea: 5 tile options, with the fifth an implied "background layer". That is, 1-(R+B+G+A).

@ethereumdegen
Copy link
Owner

I experimented with this and figured out how to support 255 textures ! check it out and let me know what you think .

@mattdm
Copy link
Contributor Author

mattdm commented Feb 14, 2024

Cool — I've been busy with other things but will look when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants