Skip to content

Fake Additional Lights

Vladislav Kantaev edited this page Jan 12, 2024 · 4 revisions

Similarly to Blob Shadows, this extension implements a more performant approach of rendering lights from the top-down perspective.

While limited to the top-down perspective and providing worse quality, Fake Additional Lights perform faster and do not have the per-object light limit.

Fake Additional Lights

Setup

📝 Note: Fake Additional Lights are NOT integrated into the built-in shaders. It requires using custom shaders (e.g., via Shader Graph).

  • In the project window, right click and select Create/Toon RP/Extensions/Fake Additional Lights.
  • Go to your pipeline asset and add the newly created asset to the Extensions list.
  • Create or open a new Default Shader Graph (Create/Shader Graph/Toon RP/Default Shader Graph).
  • Add a ToonRPFakeAdditionalLightsSubGraph node, multiply the result by the main color, and plug into Emission.
  • Add dynamic lights to the scene.

Fake Additional Lights - Shader Graph

Light Types

Fake Additional Lights currently supports point and spot lights. Their mode has to be set to either Realtime or Mixed to be rendered.

Common Parameters

Size

Size of the bigger side of the runtime light texture. The lesser side's size depends on the size of camera frustum/ground intersection and is recalculated dynamically.

Intensity

The light texture can only store colors of limited brightness. Intensity can be used to additionally scale the lighting.

Threshold and Smoothness

A ramp with these parameters is applied during light texture rendering.

Max Distance and Distance Fade

Define how far should the lights be rendered and how smooth should they disappear when near the max distance.

Receiver Plane Y

The Y position of the assumed ground, which is used to project lights onto.

Max Height and Height Fade

Similarly to Max Distance and Distance Fade defines limit and smoothness of applied lighting along the Y axis.