1. Engine Evolution 2022
  2. News
  3. NEW NATURE RENDERER

NEW NATURE RENDERER

In my previous game, I used an asset called Vegetation Studio pro. It was good, but buggy as hell and often painful to work with. So I decided to implement new spawning and rendering system for my nature. The rendering part is handled by the GPU instancer, which culls all instances that are not visible and has brilliant performance, and is also easy to use.

The first step in spawning nature was to realize that further parts of the track don't need as much attention as the surroundings of the track.



I realized that I can really populate the first 20 m from the track and nature feels dense as hell. The count of all instances was still nice so performance is good as well.



Small polishing and we get:



The next step was to implement masking. We don't want any nature inside the road. The old system (Vegetation studio) was not very precise. My system is precise to the millimeter. The downside of my system is that it takes several seconds to regenerate all the vegetation in the editor. But I don't mind several seconds of waiting while generation nature on my machine to give players the best experience on their's machines.



The next step was to make the edges of the forest denser to make distant forests more believable.



Then I have introduced 5 distinct biomes: Conifer, Leafy, Mixed, Beech, Pine.


The last step was the grass. My problem was that generating grass, in the same way, took 5+ minutes on a single map (= scene) + the map file had 500+ MB. I solved this problem write my scene serialization, which analyzes whole scenes, extracts all meshes, and leaves only colliders physically present in the scene. That way the file is really small. I have also bypassed the spawning part in my grass generating system with a method, that serializes grass out of the box smartly. This way the spawning process is fast, the scene is small and we have great performance. Lastly, I did my favorite trick, that I change the properties of an instance based on world position = I managed to have several types of grass without a performance hit.



If you haven't done so, wishlist the Engine Evolution 2022!
https://store.steampowered.com/app/1871990/Engine_Evolution_2022/

And join the games Discord.