logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

Custom Unity Renderer Swapping Tree Meshes With Interactive GameObjects

A Reddit user Creo shared their method to optimize performance.

While this concept isn't exactly new, the game's style and the way the approach is presented certainly look charming. A Reddit user known as Creo shared a demo of their custom Unity renderer that uses GPU instancing to draw tree meshes. As a player approaches, it smoothly swaps the tree mesh for a GameObject with interactive components, allowing for actions like destruction, as shown in the prototype.

As the developer explained, the core idea is that all terrain tree transform matrices are drawn using Graphics.DrawMeshInstanced, excluding the indices of nearby trees. This list is populated with trees within a specific range of the player, using a quadtree for efficient calculations. Additionally, there's a pool of pre-instantiated tree prefabs, which are moved to the designated locations using those transform matrices. The result is that only a small number of actual GameObject trees exist, while the rest are rendered with DrawMeshInstanced for better performance.

As for limitations, Creo is implementing occlusion and maximum range culling to further optimize performance, but with around 20-40 million vertices on screen, depending on the camera angle, there's still room for more. The terrain features a total of 10,000 trees, and the renderer is getting about 30 FPS more compared to Unity's built-in method of rendering terrain trees with 3 LODs and imposters. However, the distance and quality of shadows still consume a significant portion of the FPS.

For more details, check out the original post here and see the developer's other creation for this project, a tool that stitches terrain and cave meshes together:

Join our 80 Level Talent platform and our new Discord server, follow us on InstagramTwitterLinkedInTelegramTikTok, and Threads, where we share breakdowns, the latest news, awesome artworks, and more.

20 Ropes Curve Brushes all contained within one Multi-mesh brush and Low poly meshes.

Error
(2000-0001)

Join discussion

Comments 0

    You might also like

    A Week After "Basically Announcing" Minecraft 2, Notch Basically Cancels It

    Instead, he and his team will focus on the previously-announced retro-style roguelike.

    Rumor: Possible Release Date for Grand Theft Auto 6 Revealed

    A video game store from Uruguay appears to have disclosed the launch date for the gaming industry's most anticipated title.

    Breaking: Unity Suddenly Lays Off Numerous Developers With a 5 AM Email

    Apparently, the entire Unity Behavior team was cut, alongside many other employees.
    • Clearcut Series: SD Materials
      by Emiel Sleegers

      In this tutorial, you will be going over on how to create 4 very different materials from scratch in SD. The goal of these courses is to teach you a solid workflow that we also use in the AAA game industry.

      Error
      (2000-0001)
    • Lips Detail Alpha Pack
      by Todor Nikolov

      Instead of spending hours working on the lip area, you can get beautiful results within minutes with this pack.

      Error
      (2000-0001)

    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

    ×