Friday, September 13, 2019

xna - 3D Procedural Planet Generation



I was looking for some inspration for my Voxel based game I am writting and came across this: http://www.youtube.com/watch?v=rL8zDgTlXso. I would like to know how to go about (or preferably source examples) of how I would do that, in real time, and infinitley. In addition to that I was wondering how I would do this with a voxel based terrain?



A procedural planet generator in 3D which constructs voxel data, my voxels are of the same size of thoose in minecraft.


Any ideas?


Edit:


I ported the simplex noise function i_grok suggested written in C++/Python to C#, I sure hope it works :)


http://pastebin.com/TZSQwnye


Edit 2:


float noise(float x, float y, float z, float persistance, float amplitude, float frequency, float octaves)  {
float total = 0;

for (int i = 0; i < octaves; i++) {

frequency = frequency ^ i; // or frequency *= 2; ?
amplitude = amplitude ^ i;

total = total + SimplexNoise.raw_noise_3d(x * frequency, y * frequency, z * frequency) * amplitude;
}

return total;
}

Answer



There are already a lot of resources. You can start with this post on gamedev: How are voxel terrain engines made?



These answers may be closer to your question: Voxel heightmap terrain editor


Most of the noise functions discussed here are fine for real-time - some can generate a million values a second. I'm not aware of a C# implementation, but what you're looking for is Simplex Noise (sometimes called Improved Perlin Noise). Simplex Noise can scale to any number of dimensions, but most people seem to implement 2D, 3D and 4D. I have implemented Simplex Noise in C and Python if you wish to port from there. There is also a Java implementation of Simplex Noise.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...