Skip to main content
Version: 10.0

Depth Rim Lighting

Depth-based Rim Lighting is a rim lighting effect that creates a constant-size rim in screen space, meaning the rim has a more constant size, unlike traditional rim lighting.

This effect relies on the Depth Buffer/Depth Texture being active in the scene. Since this has some computational overhead, it's not always active. Some worlds will not have this enabled, and some will have it disabled.

To forcibly enable the depth buffer from an avatar, a reliable method is to add a realtime directional light to the scene, which will trigger the depth texture to be updated. A prefab called DepthGet is included in the Poiyomi Shaders package.

Requires Depth Buffer

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

Make sure to only enable the depth buffer when you need it! This can be a performance hit, and it's not always necessary.

Normal To Use​

Type
Dropdown
Options
PixeldefaultVertex

Normal to use for the depth rim light effect. Pixel uses the normal of the pixel after all normal maps have been applied. Vertex uses the normal from the mesh itself.

Rim Type​

Type
Dropdown
Options
Two SamplesFour SamplesEight Samplesdefault

How many samples to use for the depth rim lighting. This will determine what details appear in the rim as drawn by the Depth Buffer.

Shape Control​

Width​

Type
Range
Range
0to1

How wide the rim should extend from the edge.

Sharpness​

Type
Range
Range
0to1
Shown when

Binary is disabled

How sharp the edge of the rim should be. Generally, at higher sharpness, the rim will appear in less areas.

Depth Threshold​

Type
Range
Range
0to1

The amount of threshold depth to use.

Binary​

Type
Toggle

Enables the usage of Binary to control the shape's sharpness.

info

If Binary is enabled, it will disable Sharpness

Fixed Size Threshold​

Type
Float

Sets a fixed size threshold to use for the shape control.

Min Distance​

Type
Float

Minimum distance to use for the shape size.

Max Distance​

Type
Float

Maximum distance to use for the shape size.

Light Direction​

Method​

Type
Dropdown
Options
NDotLdefaultRim Dot Light

What light direction method to use for how the depth rim lighting is treated with lighting direction.

Map to Light Direction​

Type
Range
Range
0to1

Sets the mapping to the Light Direction to a specific amount.

Mix Attenuation​

Type
Range
Range
0to1

How much to mix the light direction attenuation.

Mix Ramped Light Map​

Type
Range
Range
0to1

How much to mix the ramped light map with the light direction.

Masking​

Mask​

Type
Texture Slot
Accepts
Data texturesRGB Off

Mask texture slot to mask the depth rim lighting to appear in only the specified areas of the UV.

Channel​

Type
Dropdown
Options
RGBA

If a Mask texture is used, this should select which color channel in the texture to use for the Mask.

Color​

Use Base Color​

Type
Range
Range
0to1

How much to incorporate the base color into the rim color. At 0, only the Rim Color will be used. At 1, only the base color of the mesh will be used.

Light Color Mix​

Type
Range
Range
0to1

How much to mix the rim color with the light color. The light color scaled to this value is multiplied with the rim color.

Rim Color​

Type
Color

Base color of the rim.

Color Brightness​

Type
Range
Range
0to10

How bright should the rim color appear.

Emission​

Type
Range
Range
0to20

How much emission the rim should exhibit.

Blending​

In most application, choosing one blend mode to use will be sufficient.

Replace​

Type
Range
Range
0to1

How much to replace the base color with the rim color.

Add​

Type
Range
Range
0to1

How much to add the rim color to the base color.

Screen​

Type
Range
Range
0to1

How much to blend screen the rim color to the base color.

Multiply​

Type
Range
Range
0to1

How much to multiply the rim color with the base color.

Unlit Add​

Type
Range
Range
0to1

How much to add the rim color to the light intensity (base pass only).