Unity scene optimisations

arrow down

What I learned:

  • Unity's shader (sub) graphs
  • Stylised texturing
  • Modular scene building
  • Scene optimisation
  • Unity lighting

Tools I used:

  • Blender
  • Substance Painter
  • Unity

How I optimised it

  • Shader sub graphs for reusable shader logic
  • Baked lighting where possible
  • Level of detail (LOD) for rocks
  • Used occlusion culling
  • Reduced polycount where possible
  • Combined meshes where possible
  • All materials were GPU instanced, where possible
  • All non-moving objects were static batched
  • Reduced shadow count on non-essential shadows

About this piece

Cozy Windmill

For a school project, I had to create a scene using cosy shaders. The scene had to contain a windmill, at least one tree, and a bush. I made a custom shader for both the tree and the bush to give them a more stylised look. Many of the bush's shader nodes could be reused for the tree shader, so I made reusable shader sub graphs. Alongside these shaders, I made a grass and flower shader to add more detail to the ground. The flower shader allowed for adjusting the colours of each part of the flower. In addition, I made a shader sub graph allowing the season to change to autumn for all leaves. Finally, I made a water shader for the small creek running next to the windmill.

Working from what I had before, I created a scene with a clocktower as the main focal point. Around this clocktower, I built up a castle using modular pieces. For this scene, I also made a custom shader sub graph that allowed snow to be added according to the slope and height of the surface. I used this sub graph for a new and custom rock/terrain shader and to enhance the vegetation shaders.

Clocktower Castle

Problems I faced

The biggest problem I faced early on was making the water shader look the same regardless of the object's scale. I managed to solve it by adjusting the UV coordinates based on the object's scale. Another problem I faced was figuring out a good scene composition with effective lighting. I started with some nice early-morning lighting for my windmill scene. However, between making both scenes, I accidentally lost the lighting settings for this one. I tried to recreate them for a different time of day, but I was never fully satisfied with the result.