This Project is an endlessly generating procedural landscape. Biomes are currently in the works.
There is a Chunk of terrain that is created using Unity's Perlin noise algorithm to generate random values between 0-1, then a height curve is applied to create flat water and steep hills.
To apply the texture to each chunk, it uses a shader that determins what texture should be applied based on the world position of each pixel.
The picture shows many chunks being placed in the players rendering distance, as the player traverses towards the edge of the generated chunks, the ones furthest away from the player are hidden and new ones are generated or shown infront of the player to have a seeming endless landscape.
The endless generation is done by creating chunks around the player, when the player moves a certain distance, the most distant chunks are unloaded and new ones closer to the player are created or re-enabled
Depending on the distance of each chunk from the player, the number of vertices can be lowered for better performance. Mesh near the player is created with a higher amount of vertices compared to mesh further away from players.
With three different Level of Detail settings, you can see the visible difference in the Triangle count, this allows for a boost in performance with an almost unnoticable change.
This image has 2 different level of detail meshs pictured, the border of the chunk with the lower level of detail.
This caused issues with the border each chunk not properly aligning with a chunk with less verticies. It wasn't a big issue but sometimes in the distance it wouldn't look smooth and would break immersion. The solution to this was to create a high detail border so that each chunk, no matter the detail was using the same border quality, allowing for a smooth and seamless terrain.
I have also implemented FlatShading, giving a lower poly look.
Textures are applied using a pixel shader, it gets the heigh of the pixel, and based off of that, it applies the texture. I learned about triplanar mapping to smoothly apply textures over the terrain.