Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.74k stars 159 forks source link

Proposal: Allow more than 16 textures #416

Open TechnoLukas opened 10 months ago

TechnoLukas commented 10 months ago

So i have an asset with 30 textures for the terrain, currently plugin only supports up to 16 textures. So i just chose 16 the most important ones and loaded them as texture atlas.

Describe the solution you'd like : It would be useful to import as big texture atlas as you want, for example 5x6 in my case.

Describe alternatives you've considered : Too big atlases could cause speed issues, so it would be ok to have possibility to load a bundle of texture atlases. So for example you have 3 images of 4x4 textures, in total you have 48 textures. And you just loaded 3 images.

Zylann commented 10 months ago

It's obviously desirable to have the ability to add more, but it's not something easy to add. It's relatively easy to think about, until you consider smooth blending. Current shaders could be extended to support more, but that would lead to worse performance, and VRAM usage might be an issue too. There is likely different approaches that could handle this better, it needs investigation. Notably, quick changes you can make include procedural texturing, by adding custom modifications to the shader and using slope or height as blending factor, so no extra splatmaps are required. You can also use the color map, or even density maps (normally used for detail layers) to add special modifications. You can also use Godot 4 decals to add extra details on the ground, which then avoids making them terrain textures.

However I'm currently not very active on this plugin (I mostly fix bugs when they are reported), so it's unlikely that I will add this anytime soon. You may have to experiment your own solution.