Skip to content

Global Ramp

Vladislav Kantaev edited this page Oct 27, 2023 · 8 revisions

Global Ramp Modes

Toon RP allows controlling lighting ramp (smoothness and threshold) globally for all materials.

To specify a custom ramp per-material, use the Override Ramp material option.

Threshold controls where the shadow should begin, Smoothness - how smooth should it be. Separate sets of the parameters are available for diffuse, specular, and rim lighting.

The following global ramp modes are available:

Default

Default Ramp

Crisp Anti-Aliased

Makes the shadow crisp as with zero Smoothness, but prevents aliasing artifacts.

Crisp Anti-Aliased Ramp

Texture

Specifies the ramp as a greyscale texture, which allows to specify various number steps, varying smoothness, etc.

In addition, one can make it vary along the vertical axis. By default, UV is used to compute the vertical position along the ramp, but the source can be arbitrary in a Shader Graph.

📝 Note: Texture mode also affects specular and rim lighting. Specular and rim ramp parameters (Threshold and Smoothness) serve as way to control the ramp for specular and rim separately and more precisely.

Example:

HandDrawnRamp

Ramp Texture

Ramp Generation Utility

To simplify ramp texture creation, Toon RP comes with a utility to generate basic ramp textures. It is located in Window/Toon RP/Ramp Generation Utility.

Ramps are defined via the default Unity gradient editor.

💡 Tip: crisp ramps are easier to construct using the Fixed gradient mode (as upposed to Blend).

Ramp Generation Utility

References