Performance

Apparently tessellation used in conjunction with LODs on foliage objects has caused major performance problems for some users, but I went in knowing from the start that rendering a realtime forest with tessellated foliage was a tall order. Initially the trees performed well enough, but I grew hungrier and the scene grew bigger until optimization couldn’t be ignored.

My solution was to aggressively cut down on the amount of tessellated geometry on-screen at any given time. The trees were heavily pruned of polygons. The material I created for the trees decreases the tessellation iterations dynamically as distance from the camera grows, the performance was still quite awful until I removed tessellation altogether from LOD1 and up. Visually no different but a modest improvement in framerate, there is evidently a large overhead cost you must pay when using a tessellated material.

These measures helped but the scene still chugs in many densely forested places. Flythroughs may have to wait until I get better hardware.

Materials

The material uses vertex colors to determine what branches get a light or heavy coat of snow, the dead branches originally had their own material but were integrated into the main one to make painting possible and save on drawcalls. Ambient occlusion was baked with Turtle in Maya into the vertex colors of the trees to serve as a base for painting since some of the inner areas are really hard to reach with a brush, the rest of the painting was done inside UE. The key component of this material is the world aligned blend node that determines whether the normals of a face are pointing up or down in the world and biases it toward light or heavy snow accordingly.