Very cool man, I can't see your code on my phone screen but I'm guessing Perlin Noise for the height map with something to colour it based on height. I made something like this for my current game project but only in 2d as I'm going for a top down look. You should try wrapping your map around a sphere, that would look awesome. :)
So I intend to do a full write eventually, but I'll add some detail here. The height map is determined by 3 noise channels with different settings blended together. A baseline Simplex Noise channel handles the gradual, continent spanning changes in elevation that produces a smooth slightly wavy landscape. A second Perlin Noise channel handles mountains and hills, and left to its own devices just gives an infinite mountain landscape. A third Simplex Noise channel just goes from 0 to 1, and controls "how much mountain" to add to the baseline noise. So it goes:
This gives a smooth transition between noise types while allowing a lot of variation.
Color is handled by old school vertex colors for each triangle, informed by which biome the triangle falls into. It does this by two more noise channels that measure temperature and moisture (hot + dry = desert, hot + wet = jungle, etc). Each biome has its own color associated, and that color gets applied to the triangle. Triangles that have a steep slope are shaded for rock, and triangles just above the water line are shaded for beach.
Once you started running around in it at first I thought you might have used Marching Cubes or Marching Tetrahedrons, but you are just placing the vertices of a plane that is usually done with a height map it looks like.
Still cool. I love this stuff. I mess with weird side projects like this all of the time too. I blogged about some of my voxel, tile, and other side diversions today.
Looks cool. Are you just using a Vertex Shader there?
Yep, vertex shading is being used for the mesh. Since I wanted each triangle to be a flat shaded solid color, vertex shading make it pretty simple, with the option to still overlay a texture if I so choose.
I really am just using a height map derived from a noise function. Most of the interesting code is how noise values are blended to give interesting terrain, and making Unity play nice with true multithreaded generation in order to run at a decent speed while spitting out chunks of terrain.
I'm probably not gonna do much more work with this project. I'm currently playing with Compute Shaders and seeing if I can implement Marching Cubes to give something more interesting/varied than a heightmap.
Very cool man, I can't see your code on my phone screen but I'm guessing Perlin Noise for the height map with something to colour it based on height. I made something like this for my current game project but only in 2d as I'm going for a top down look. You should try wrapping your map around a sphere, that would look awesome. :)
So I intend to do a full write eventually, but I'll add some detail here. The height map is determined by 3 noise channels with different settings blended together. A baseline Simplex Noise channel handles the gradual, continent spanning changes in elevation that produces a smooth slightly wavy landscape. A second Perlin Noise channel handles mountains and hills, and left to its own devices just gives an infinite mountain landscape. A third Simplex Noise channel just goes from 0 to 1, and controls "how much mountain" to add to the baseline noise. So it goes:
This gives a smooth transition between noise types while allowing a lot of variation.
Color is handled by old school vertex colors for each triangle, informed by which biome the triangle falls into. It does this by two more noise channels that measure temperature and moisture (hot + dry = desert, hot + wet = jungle, etc). Each biome has its own color associated, and that color gets applied to the triangle. Triangles that have a steep slope are shaded for rock, and triangles just above the water line are shaded for beach.
Very cool man, you should definitely do a full write up. :)
Once you started running around in it at first I thought you might have used Marching Cubes or Marching Tetrahedrons, but you are just placing the vertices of a plane that is usually done with a height map it looks like.
Still cool. I love this stuff. I mess with weird side projects like this all of the time too. I blogged about some of my voxel, tile, and other side diversions today.
Looks cool. Are you just using a Vertex Shader there?
Yep, vertex shading is being used for the mesh. Since I wanted each triangle to be a flat shaded solid color, vertex shading make it pretty simple, with the option to still overlay a texture if I so choose.
I really am just using a height map derived from a noise function. Most of the interesting code is how noise values are blended to give interesting terrain, and making Unity play nice with true multithreaded generation in order to run at a decent speed while spitting out chunks of terrain.
I'm probably not gonna do much more work with this project. I'm currently playing with Compute Shaders and seeing if I can implement Marching Cubes to give something more interesting/varied than a heightmap.
Nice. I haven't messed with compute shaders. I should as they could save the day on some of my weird side things.