Skip to content

Random procedural city generator using Perlin Noise and Crawler with custom Dynamic Occlusion Culling in Unity

Notifications You must be signed in to change notification settings

bsiedlikowski/perlin-noise-procedural-city-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

City Generator

This project creates cities with random roads layout and random, procedurally generated buildings with use of Perlin Noise.

Demo

Generating

City layout is generated by firstable using crawler which is randomly choosing to go straight or to turn in one of the directions and placing suitable piece of road in this position. After that, overlapping road pieces are swapped with a correct crossroad. Then generator is searching between the roads for a place to build structure which are being created with use of Perlin Noise as a grid of vertical buildings with different heights made from modular elements.

Optimizations

To optimize large amount of objects in the scene I used meshes combining. As a result, the number of draw calls decreased drastically. The most significant change however, was adding a custom dynamic occlusion culling, which enables mesh renderers for only visible objects (not occluded by other objects and within the camera's field of view). It has been implemented by shooting fixed number of raycasts from current camera position, enabling hitted objects and hiding them again after fixed amount of time without being hitted. In order to increase the optimisation even further, it is advised to not create additional building parts within the structures.

About

Random procedural city generator using Perlin Noise and Crawler with custom Dynamic Occlusion Culling in Unity

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages