Skip to main content
Version: 10.0

Contact Shadows

Contact Shadows is a screen-space rendering technique that adds, refines, or hardens shadows at the point where objects meet. This can address the limitations of traditional shadow maps by creating precise, small-scale shadows for finer details.

Pro Feature
Requires Depth Buffer

In order to use Contact Shadows, you will need to place the DepthGet Prefab found in the Assets/_PoiyomiShaders/Prefabs on your avatar.

Animation Toggle

  • Type: Toggle

This checkbox allows toggling Contact Shadows at runtime.

tip

Contact Shadows is enabled by default. To turn off Contact Shadows in-game, you need to animate this Toggle (checkbox) when creating toggles for Squish on this Material. Animating the Section Header will not work!

Shadow Intensity

  • Type: Float, Range: 0.0 - 1.0

Sets the overall intensity of the contact shadows.

Max Distance

  • Type: Float, Range: 0.001 - 0.2

Sets the maximum distance of the contact shadows.

Quality

  • Type: Float, Range: 1.0 - 10.0

Sets the overall quality of the contact shadows.

Performance Warning

This directly controls how many samples from the depth buffer it takes for each pixel it is run on. If you fill your display with pixels (common when cuddling, for example) this performance cost adds up. Make sure you evaluate changes in-game and in VR - artifacts isn't generally as noticeable in motion.

Thickness

  • Type: Float, Range: 0.0001 - 0.05

Sets the overall thickness of the contact shadows.

Depth Bias

  • Type: Float, Range: 0.0 - 0.05

Clips away the least intense shadows to help reduce visual artifacts.

Light Source

Light Source

  • Type: Dropdown, Options: Main Light/Custom Direction

Chooses the source of Light to use when rendering contact shadows. By default, the main light source will be used.

Custom Light Direction

  • Type: Float4
    • Conditional: Requires Light Source set to Custom Direction

This determines the custom light direction pivot on the X, Y, Z, and W axis.

Falloff

Camera Distance Falloff

  • Type: Float2

Determines the falloff distance for the Camera on the X and Y axis.

Application Mode

Apply Mode

  • Type: Dropdown, Options: Color Blend/Lightmap Multiply/Both

Sets the depth application mode to use when applying the contact shadows.

Color And Masking

Use Mask

  • Type: Toggle

If enabled, exposes a texture slot below to use for masking contact shadows.

Mask

  • Type: Data Texture (sRGB = OFF)

Linear texture to use for the mask.

Shadow Color

  • Type: Color

Sets the color of the shadows.

Blend Mode

  • Type: Dropdown, Options: Replace/Darken/Multiply/Lighten/Screen/Subtract/Add/Overlay

Sets the blending mode to use for the shadow color.

Global Masks

Normal Rejection

  • Type: Float, Range: 0.0 - 1.0

Sets the normal rejection amount from Global Masks.

Hide In Light

  • Type: Float, Range: 0.0 - 1.0

How much to hide to/from Global Masks from the light.

Dither Noise

  • Type: Float, Range: 0.0 - 1.0

How much dithering to apply to/from the Global Masks.

Rejection Depth

  • Type: Float, Range: 0.001 - 1.0

Sets the depth for the rejection.

Apply From Global Mask

  • Type: Dropdown, Options: Off/1R/1G/1B/1A/2R/2G/2B/2A/3R/3G/3B/3A/4R/4G/4B/4A

Selects which Global Mask channel to apply Contact Shadows from.

Apply To Global Mask

  • Type: Dropdown, Options: Off/1R/1G/1B/1A/2R/2G/2B/2A/3R/3G/3B/3A/4R/4G/4B/4A

Selects which Global Mask channel to apply Contact Shadows to.

Debug

  • Type: Toggle

Creates a debugging visualizer to show the expected behavior of Contact Shadows.