Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.59k stars 244 forks source link

What is the meaning of return value for generate_block() now? #314

Closed slapin closed 2 years ago

slapin commented 2 years ago

Hi, was a bit confused by a change with return value of generate_block() function (and corresponding gdscript _generate_block() function). What is the meaning of the setting? I use custom generator for VoxelLodTerrain (transvoxel). Looking at the code did not completely explained it...

Zylann commented 2 years ago

It is something I started doing and could not complete entirely, but I thought of keeping that part for now. It's an optional return value in which a generator can specify that the data it returns is at the maximum precision it can be. For example, if you are sure the generated area does not have any more information inside it, even if requested at a higher level of detail, then a hint can be returned telling that with {"max_lod_hint": true}. This gives the possibility to terrains to stop subdividing their octree because all the blocks can be inferred from lower-res. Right now it's not used, but I thought it would be useful for future optimization. If this bothers scripting maybe I could remove that from the virtual function?

slapin commented 2 years ago

I don't think there is need to remove anything, was just curious. The script update was trivial anyway.

slapin commented 2 years ago

Thanks for explanation.

Zylann commented 2 years ago

I removed the change of return value in 7f8eabe21f3f72914a94430b109df1dc9c483fd8 because I believe it doesnt need to be added until the module actually makes use of it.