Skip to content
/a/ FaceCue Performance Studio

Light

How bright the scene is where the character stands. This is what the pupils respond to.

The Source

Implement ILightSource and assign it to the brain's LightSource.

Member What it returns
bool HasSceneLuminance Whether a reading is available at all
float SceneLuminance The reading, when there is one

The two-part contract matters. A source that cannot answer, because the character is somewhere it has no measurement for, says so through HasSceneLuminance instead of returning a guess, and the pupils stay where they were.

A source that samples your lighting at the character's head is the steady answer. FaceCue does not sample lighting itself.

Setting an Override

brain.SetSceneLuminance(this, 0.15f);   // walking into a dark room
Method Does
SetSceneLuminance(float) Claims the anonymous lane
SetSceneLuminance(object owner, float) Claims it as this owner
ReleaseSceneLuminanceOverride() Gives back the anonymous lane
TryReleaseSceneLuminanceOverride(object owner) Gives it back only if this owner still holds it
ForceClearSceneLuminanceOverride() Takes it back regardless

Asking About It

Member Tells you
HasSceneLuminance Whether a reading is available, override or source
SceneLuminance The resolved reading
IsSceneLuminanceOverridePresent Whether an override is masking the source
IsSceneLuminanceOverrideOwner(object owner) Whether this owner holds it
SceneLuminanceOverrideOwner Who holds it
SceneLuminanceOverrideOwnerKind None, Anonymous or Explicit

Events

LightOverrideChanged fires when the override changes, with a LightOverrideChange carrying:

Field Holds
Transition Which kind of change. See Sources and Overrides
HadPreviousOverride Whether an override was present before
PreviousValue What it was
PreviousOwnerKind Who held it before

Where It Reaches

The pupils, in Gaze. They widen in the dark and narrow in the light, on their own timing, and the response composes with the two others the pupils already have: what the character is feeling and whether it is concentrating.

Without this lane the pupils still move, from feeling and thought alone. What they will not do is react to the scene, so a character walking from daylight into a cave keeps daylight pupils.