- Home /
Question by
MisterYO1122 · Apr 02, 2017 at 10:12 AM ·
optimizationwatervoxelvoxels
How do you handle water in voxel games?
I've been working on a voxel game kind of like minecraft for a few days.
The problem is that after I added water to the game, it started lagging very badly (like 11-12 fps). Right now, to update the water I'm doing a nested loop to go trough all the blocks in every chunk and check if I hit a water block, then move the blocks.
Also, right now I have 2x4x2 chunks, each having 10x10x10 blocks.
How do I update the water without lagging the game?
Comment
Only update the water in the zones the player is near. Also if you are using actual blocks and not chunk meshes, then you will never remove the lag.