Search Unity

Question Why are terrain billboards so fast?

Discussion in 'General Graphics' started by DrSpritz, Jan 13, 2023.

  1. DrSpritz

    DrSpritz

    Joined:
    Oct 6, 2013
    Posts:
    29
    Hi there,

    My name is Andrey, I am an indie developer making mobile games for my own pleasure and have made a few games like StarCombat and Pests Buster.

    I am currently working on my new game, an online flight combat arcade, called Modern Jet Fighters, and focused on mobile devices. I'm trying to create a large, open world with forests, roads, and cities.


    Снимок экрана 2023-01-13 в 14.30.06.png Снимок экрана 2023-01-13 в 14.29.37.png Снимок экрана 2023-01-13 в 14.39.56.png Снимок экрана 2023-01-13 в 14.36.36.png

    At the moment, I need to plant a 50x50 km terrain with a dense forest and make it work on a mobile device.

    I have seen such an implementation in other games, for example in SG: Infinite Jets. The guys from Atypical Games have created a game world of incredible proportions and details. This gives me confidence that such things are possible on mobile devices.


    I'm trying to repeat this in my game and use my own low-poly 3d model with a simple unlit shader, which consists of 8 triangles and looks more like a billboard. To draw vegetation, I used different methods: instance rendering; static batching + LODs; mesh combining by cells + LODs for each cell. But nothing is even close to how the terrain renders vegetation on billboards. On an area of 1 sq. km., I planted 20,000 trees and got 60 FPS on Google Nexus 5 with a static camera!


    I noticed that when the camera orientation changes, billboards are redrawn with a performance drawdown, including some time after the rotation changes stop. When moving the camera, I did not notice such drawdown, even with changes to the "Quality/Terrain/Billboards Face Camera Position" settings, which, according to my expectations, should have led to redrawing when the camera is moving (perhaps this is a bug and this option is not used in URP).


    The video shows how the rendering method changes during rotation and after it ends.

    Does anyone know what's going on under the hood of the terrain?

    I have the desire to find a way to abandon the use of a billboard (the process of turning the mesh to the direction of the camera plane) and use a static mesh of 8 triangles, but draw it using the «magic» method that the terrain uses. I think this will avoid drawdowns when rotating the camera and will allow the game to work as smoothly as when moving the camera with billboards without any camera rotations.

    Thanks to everyone who read my post. I would be grateful if someone would share their thoughts on this or share with us how it really works and how it can be adjusted.