Skip to content

2401lucas/ProcedurallyGeneratingEcosystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Endless Procedural Ecosystem

This Project is an endlessly generating procedural landscape. Biomes are currently in the works.

The Terrain Generation

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.

image

Endless Terrain Generation

endlessDemo 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

Level of Detail over Distance

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. image

This image has 2 different level of detail meshs pictured, the border of the chunk with the lower level of detail. image

Seamless Chunk Borders

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.
image

FlatShading

I have also implemented FlatShading, giving a lower poly look. image

Textures

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.

Without Triplanar

image

With Triplanar

image

I also Used Texture Blending near the edges to jagged changes between textures.

This is without the blending.

image

With Texture Blending

image

About

An endlessly generating procedural map

Resources

Stars

Watchers

Forks