The rim light of a map: one directional light that adds a colored highlight to
characters. It is the RimLightProperties value of the map's
MapLightRegions feature.
This class sets the direction and the shape of the light. The color is not here. It
is the RimLightColor of each light region, so
the rim can have one color in one part of the map and another color, or none, in
another part.
What is lit. Characters only, which means every skinned mesh. Environment
geometry and particles do not get the rim.
How the client computes it, per pixel of a character:
rimColor = RimLightColor, blended over the light regions at the pixel
if rimColor is black: no rim
c = min(Contrast, 0.99999)
ramp = saturate((dot(normal, direction) - c / 2) / (1 - c))
ramp *= lerp(1, sunShadow, SunShadowBlendWeight)
ramp *= smoothstep(0.4, 0.6, height)
color = lerp(rimColor, CharacterSunLightColor, SunLightBlendWeight)
color *= the texture color at full brightness
result = lighting + color * ramp
direction comes from rotation. The light does not depend on the camera: a
surface gets the rim when its normal points toward the light.
sunShadow is the shadow of the character sun light at the pixel, from 0 (in
shadow) to 1 (lit), after the
shadow gradient of the skin.
height is the height of the vertex in the bind pose, as a fraction of the
ModelHeight of the skin. The rim fades in between 40% and 60% of that height, so
the lower part of a character gets no rim.
- The texture color at full brightness is the color of the skin texture with its
HSV value set to 1. The rim takes the hue of the surface and ignores how dark the
texture is.
- The rim is added before the tone map.
Examples: - A rim from straight above in the color of the region:
Enabled true and the default values, with a RimLightColor on the default light region. - A rim that takes the color of the sun:
SunLightBlendWeight 1. RimLightColor must still be above 0 in at least one channel, because a black RimLightColor turns the rim off.