A Comprehensive Guide on Run-Time Procedural Placement in Unity

Kacper Szwajka presented an in-depth article describing an efficient method for implementing run-time GPU placement of objects on terrain.

In case you missed the news, Technical Artist and Art Director Kacper Szwajka unveiled a couple of incredible behind-the-scenes demos last week, teasing a then-upcoming article for procedural generation enthusiasts and promising to present said article in the near future. Less than a week later, the artist delivered on his promise, revealing a comprehensive write-up that thoroughly describes a method for implementing run-time GPU placement of objects on the terrain in Unity, inspired by Guerilla's Horizon Zero Dawn.

In the article, the author discussed the advantages of procedural placement, stating that it helps performance by allocating memory only for rendering instances within the camera's range and dynamically scattering them as the camera moves, as well as makes the process of placing objects over large terrains less tedious and time-consuming.

Then, the creator explained how Compute Shaders help execute the system's logic, described the concepts of a 'footprint' and 'ecotypes', and explored the system's chunks, each containing pointers that would become object instances. Additionally, Kacper shared several snippets of code, allowing you to recreate the system in Unity very quickly and easily.

Moreover, the developer discussed the generation of random numbers, showed how to select the appropriate prototype for each pointer and how to control how densely prototypes are placed in different areas, and shared a neat technique for managing overlapping instances.

Finally, the author talked about the system's real-life applications, discussing how it can be used for dynamic terrain generation with biome-specific features, real-time environment alteration, and growth over time. You can read the full article by clicking this link.

If you would like to learn more about procedural generation in Unity, here are some great tutorials that might help you out:

Don't forget to join our 80 Level Talent platform and our Telegram channel, follow us on InstagramTwitter, and LinkedIn, where we share breakdowns, the latest news, awesome artworks, and more.

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more