Daydream Renderer

Daydream Renderer is a Unity package designed for high-quality rendering optimized for the Daydream platform. Daydream Renderer is best for scenes that make significant use of dynamic lights, normal maps, shadows, or environmental maps. For example, a photorealistic environment or a stylized environment with highly detailed surfaces (i.e. not flat shaded).

Daydream Renderer is available on GitHub. The latest Unity package release can be found in the releases section.

Key features

  • Single pass rendering.
  • Supports surfaces with normal maps and specular highlights influenced by up to 8 dynamic lights with a fixed fragment shader cost.
  • Normal mapped specular approximation including optional optimizations such as monochromatic specular color.
  • 1 - 4 per-object "hero shadows" with cheap but effective filtering.
  • Vertex based static lighting solution that seamlessly integrates with dynamic lighting and fully supports normal mapping and approximated specular.

Use cases

Daydream Renderer can help you out in the following scenarios:

  • You need many dynamic lights in the scene and still want to render everything in a single pass.
  • Your art style requires per-pixel lighting with support for normal maps and specular.
  • You want to use performant dynamic shadows, limited to a small number of shadow casters (e.g. player character and key NPCs).
  • You have a finely tessellated scene and want more performant static lighting solution.
  • Your light bakes are taking too long and you would like to improve bake times.
  • You're planning to write custom shaders for your app and are looking for a starting point.
  • You want performant reflections from static environment maps.

Performance improvements

High quality mobile VR apps target high resolution displays which require rendering a large number of pixels, must target 60 fps, and must draw everything twice. This puts a lot of strain on the device GPU, CPU, and the data bus. Daydream Renderer makes the most of these limited resources by avoiding common bottlenecks:

  • Daydream Renderer offloads much of the lighting computation from pixel shaders to vertex shaders.
  • A typical Daydream app has approximately ten times more pixels than vertices so moving computation from pixel to vertex shader is an order-of-magnitude savings.
  • Daydream Renderer doesn’t redraw objects for every light influence, which significantly reduces the total number of draw calls used.
  • Daydream Renderer shaders are optimized to limit the number of texture look-ups to a maximum of two, which avoids shader pipeline stalls.
  • Daydream Renderer allows for some post-process effects without an extra rendering pass by appending the calculation to the end of the pixel shader.

Trade-offs

Daydream Renderer makes some tradeoffs in exchange for performance gains:

  • Per-pixel lighting is approximated, which can cause unexpected lighting artifacts especially in scenes without a lot of tesselation.
  • Some functionality from the Unity standard shaders is lost.

Further information

Please consult README.md for detailed instructions and documentation.