TokisanGames / voxelgame

Voxel world prototype made with Godot Engine
Other
94 stars 25 forks source link

can you create a planet demo? #1

Open xukongwen opened 4 years ago

xukongwen commented 4 years ago

thanks for the greate demo! can you create a planet demo for me? i'm come from youtube...

thanks!

TokisanGames commented 4 years ago

Hi, if you look in mystream.gd, you'll see an example of how to write a generator for a sine wave. You need to write a generator that uses the signed distance function (sdf) of a sphere: http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/

Basically set ground where the distance from 0,0 0 to x, y, z is < radius. Or length of Vector3(x, y, z) < radius.

It is something I want to do, and really it should be implemented in C++. But you can do it in gdscript.

xukongwen commented 4 years ago

thanks!

TokisanGames commented 4 years ago

Zylann is writing a VoxelGraph that should make it easier to make new shaped landscapes, including planets, without having to write faster C++ modules. Watch the main repo for when that gets released.