Skip to content

Forest Demo Breakdown

Vladislav Kantaev edited this page Aug 6, 2022 · 6 revisions

This page describes the major points about how the forest demo was created.

Ramp

Alpha channel of Shadow Tint controls the strength of diffuse attenuation.

Alpha=100% Alpha=50%
Alpha=100% Alpha=50%

Ramp Threshold controls where the shadow should start.

Ramp Threshold=0.187 Ramp Threshold=-0.23
Ramp Threshold=0.187 Ramp Threshold=-0.23

Ramp Smoothness controls the rate at which a bright area changes into the dark.

Ramp Smoothness=0.713 Ramp Smoothness=0.11
Ramp Smoothness=0.713 Ramp Smoothness=0.11

The shader supports triple-step ramps out of the box (Triple Ramp toggle). The position of the second step is also controllable.

Double Ramp Triple Ramp
Double Ramp Triple Ramp

Rim

Rim toggle enables rim (Fresnel) reflections.

Rim On Rim Off
Rim On Rim Off

Rim color supports HDR, which can be used for bloom. To implement bloom, one should:

  • Enable HDR in UniversalRenderPipelineAsset
  • Enable the Post Processing toggle on the camera
  • Add the Volume component to the camera, create a profile
  • Click Add Override/Post Processing/Bloom and configure bloom's parameters
Bloom Off Bloom On
Bloom Off Bloom On

Additional Lights

Additional Lights are enabled by default in the shader. Make sure they are enabled in UniversalRenderPipelineAsset. Additional lights use the same ramp that is used for the main light.

SSAO

Screen Space Ambient Occlusion is an image effect that adds shadows near objects' intersections (such areas are assumed to "trap" light rays). The toon shader supports URP's SSAO out of the box. Documentation for SSAO is available here.

SSAO On SSAO On

SSAO Off SSAO Off

Outline

The demo relies on UnityFx.Outline package. More details on configuring it for URP are available in the official README.

Outline On Outline On

Outline Off Outline Off

Clone this wiki locally