Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.71k stars 251 forks source link

How to add water to smooth terrain #704

Open FingertipsLeap opened 2 months ago

FingertipsLeap commented 2 months ago

Thank you to the author for providing such an excellent plugin. But when I use it to create smooth terrain and want to add lakes or oceans to it, I find that there is no suitable solution. I may create two VoxelPodTerrain, one to generate terrain and the other to generate water surface, but this consumes a lot of performance and is not very suitable. Does the author have a support plan for water. thank you very much indeed

Zylann commented 2 months ago

I have no near plan currently for water in this module. Water in smooth voxels is indeed super expensive especially if you expect it to flow. In a project I was thinking of doing water with a simple subdividing plane height based, or a post-processing effect, not using voxels.

Calandiel commented 1 month ago

What would you suggest for something akin to Minecraft's water (or transparent blocks in general), within the context of this repo?

Zylann commented 1 month ago

This is an issue about smooth terrain, not blocky. Not the right place to ask this. If your question is about how to do transparent blocks with VoxelMesherBlocky, use different materials for transparent parts. As for Minecraft-like water, that stuff is not built-in, you'd have to make the water models and set the right ones by changing voxel values with your own simulation code. There is a blocky_fluids branch that adds experimental support for procedural water models similar to Minecraft, but you still need to implement the simulation part yourself.

Calandiel commented 1 month ago

I might have been imprecise, when I said "something akin to Minecraft's water", I meant the cellular automata update rules and the transparency rather than the way meshing happens :slightly_smiling_face: I did mean smooth terrain - that's how I ended up in this issue.

In either case, thanks!