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.
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.
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
- Range
- Range
- 0to1
Sets the overall intensity of the contact shadows.
Max Distance
- Type
- Range
- Range
- 0.001to0.2
Sets the maximum distance of the contact shadows.
Quality
- Type
- Range
- Range
- 1to10
Sets the overall quality of the contact shadows.
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
- Range
- Range
- 0.0001to0.05
Sets the overall thickness of the contact shadows.
Depth Bias
- Type
- Range
- Range
- 0to0.05
Clips away the least intense shadows to help reduce visual artifacts.
Light Source
Light
- Type
- Dropdown
- Options
- Main LightCustom 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
- Shown when
Light Source is 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 BlendLightmap MultiplyBoth
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
- Texture Slot
- Accepts
- Data texturesRGB Off
Linear texture to use for the mask.
Shadow Color
- Type
- Color
Sets the color of the shadows.
Blend Mode
- Type
- Dropdown
- Options
- ReplaceDarkenMultiplyLightenScreenSubtractAddOverlay
Sets the blending mode to use for the shadow color.
Global Masks
Normal Rejection
- Type
- Range
- Range
- 0to1
Sets the normal rejection amount from Global Masks.
Hide In Light
- Type
- Range
- Range
- 0to1
How much to hide to/from Global Masks from the light.
Dither Noise
- Type
- Range
- Range
- 0to1
How much dithering to apply to/from the Global Masks.
Rejection Depth
- Type
- Range
- Range
- 0.001to1
Sets the depth for the rejection.
Apply From Global Mask
- Type
- Dropdown
- Options
- Off1R1G1B1A2R2G2B2A3R3G3B3A4R4G4B4A
Selects which Global Mask channel to apply Contact Shadows from.
Apply To Global Mask
- Type
- Dropdown
- Options
- Off1R1G1B1A2R2G2B2A3R3G3B3A4R4G4B4A
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.