BenjaTK / Gaea

Procedural generation add-on for Godot 4.
https://benjatk.github.io/Gaea/
MIT License
898 stars 40 forks source link

[NoiseGenerator] Render different tiles to different Tilemaps #108

Open OptimusLime opened 2 months ago

OptimusLime commented 2 months ago

Thank you for the excellent repository.

I am looking to take different Tiles from the NoiseGenerator (e.g. Deep water, shallow water, sand, grass, deep grass) and render each particular Tile layer to different TileMaps in the TilemapGaeaRenderer.

Why do this?

Shader Materials are applied to the entire tilemap. If I have a shader material for my water tiles, but I don't want it applied to any other tilemap layers (e.g. sand, grass, etc), how can I support this in Gaea? You could imagine that every biome might have shaders applied at the tilemap layer and want layer-wise tilemap rendering.

It would seem that it's compatible with the way the Tiles from NoiseGenerator are being generated, the code is just missing a specific tilemap to render into. Alternatively, another hack would be to have a shared Tilemap resource, then 2 TilemapGaeaRenderers, and select which Tiles are included/excluded from the rendering for the target Tilemap. Then I could render some layers to one tilemap and other layers to another.

Any thoughts on how I could:

  1. hack this quickly
  2. More permanent and principled solution?

Thanks again, really great work!

BenjaTK commented 2 months ago

Hm, this is an interesting problem. And not sure how it could be fixed. Maybe a new renderer, but I don't think it should be implemented natively. One that would take the TileInfo's layer (not tilemap_layer) and have different Tilemaps for each. I do think the TileMap layer system will be overhauled in Godot and each layer will be a different node, so it should be easier then.