POLYMASON

Billboard trees in Unity

Part of LODs and billboards for low poly models

Past a few hundred meters, you can draw a picture of the tree in place of the tree. A billboard is that picture on a quad that turns to face the camera. One quad is two triangles, and the crossed pair PolyMason exports is four, in place of a few hundred. A forest of them costs almost nothing. This guide makes one and shows it in Unity. Billboards are the far end of levels of detail. The levels before them go in the LOD Group, the trunk under them gets a collider, and the picture is one material like everything else, which the materials article explains.

The picture

Render the tree straight on against a transparent background, at a size that will be bigger on the texture than it will ever be on screen. For a far billboard, 256 pixels tall is plenty. Light it the way the scene lights things, or leave it unlit, since the quad will be lit as one flat surface and shading painted into the picture will look wrong from the other side. For a crossed pair of quads, render the side view too.

PolyMason renders both when you select billboards at export. You get front and side PNGs of the tree on transparent backgrounds, and an OBJ of the crossed quads with the pictures mapped onto them.

A quad with a cutout material

The simplest billboard is a quad in the scene:

  1. Import the PNG. In its import settings, turn Alpha Is Transparency on and set Filter Mode to Bilinear.
  2. Make a material. In Built-in, use Standard with Rendering Mode Cutout. In URP, use Lit with Surface Type Opaque and Alpha Clipping on. Put the PNG in the albedo slot and set smoothness to zero.
  3. Make a Quad, scale it to the tree's width and height in meters, and put the material on it. To set its pivot at the base, parent it to an empty and offset it by half its height, so it stands on the ground where the tree stood.
  4. Add it as the last level of the tree's LOD Group, before Culled.

A single quad shows its edge when seen from the side. The crossed pair, two quads at right angles, fixes that for a static billboard, and it's what PolyMason exports. The other fix is to turn one quad to face the camera. A small script sets the quad's rotation to look at the camera each frame, keeping it upright. That's the classic billboard, and it looks better for trees than the cross does, at the cost of a script per instance.

A Billboard Renderer

Unity's own component for this is the Billboard Renderer. It shows a Billboard Asset, which holds the picture, the size, and how it's cut into images from different angles. SpeedTree makes these assets automatically. For your own tree you make one in code with BillboardAsset, setting its texture, width, height, bottom offset, image coordinates and the vertex layout, and then assign it to the renderer. It always faces the camera, batches well, and needs no script per instance. The quad is less work for a handful of trees, and the renderer is less work for a forest.

Terrain trees

Trees painted onto a Unity Terrain get billboards for free. The terrain settings have a Billboard Start distance, beyond which every tree becomes a billboard the terrain generates from the model, and a Fade Length for the transition. Terrain trees also get their own LOD handling. They don't get a collider for free. The terrain copies the collider that's on the prefab, so a prefab without one has no collision. The catch is that terrain trees must be prefabs with a mesh renderer at their root. The billboard is generated from the model's own look, so a flat-shaded, palette-textured tree billboards well.

Keeping it from looking flat

  • Match the lighting. A billboard lit as a flat surface looks lit from a different direction than the meshes around it. Unlit billboards with lighting painted in, rendered under the scene's light direction, match better than lit ones.
  • Match the colors. Render the picture with the tree's palette instead of a placeholder, and at the same exposure the scene uses.
  • Cross-fade the swap. Set the LOD Group's Fade Mode to Cross Fade so the mesh dissolves into the picture and doesn't pop.
  • Keep the ground contact. The billboard's bottom should sit exactly where the trunk met the ground. A floating or buried billboard is the first thing people notice.

What PolyMason exports

Select billboards at the export step and the zip includes the front and side pictures on transparent backgrounds, sized from the tree's own bounds. It also has an OBJ of the crossed quads, with a material library that maps the pictures onto them. Drop them in with the tree's levels and add the quads as the last level of the group.

More in this guide

  • LODs and billboards for low poly modelsHow levels of detail work, what triangle counts are reasonable for low poly trees, rocks, buildings and characters, how to make the levels so the swap doesn't pop, billboards and impostors for the far distance, and the LOD setup in Unity, Godot and Unreal.
  • Unity's LOD Group from separate model filesHow to build a LOD Group in Unity from three separate model files, what the screen-height thresholds mean, the naming convention that makes the importer build the group for you, fade modes, LOD Bias, and how LOD Groups work with batching and instancing.
  • Godot 4 LODs: mesh LODs and visibility rangesGodot 4 has two LOD systems, the automatic mesh LODs the importer generates and the visibility ranges you set on nodes. This covers how to control each, fading between levels, and how they work with MultiMesh for a forest.
  • Tree colliders in Unity: a capsule on the trunkWhy a tree's collider should be a capsule around the trunk with nothing around the canopy, how to set it up on a placed tree and on a terrain tree, what Generate Colliders on the importer gets wrong, and the same setup in Godot and Unreal.

Or build a tree and see what comes out.