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 { get; } Whether a reading is available at all
float SceneLuminance { get; } 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
Member What it does
void SetSceneLuminance(float value) Claims the anonymous lane
void SetSceneLuminance(object owner, float value) Claims the lane as this owner
bool ReleaseSceneLuminanceOverride() Gives back the anonymous lane. True when there was one to give back
bool TryReleaseSceneLuminanceOverride(object owner) Gives the lane back only if this owner still holds it. True when it did
bool ForceClearSceneLuminanceOverride() Takes the lane back whoever holds it. True when there was an override to clear

Asking About It

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

Events

event Action<LightOverrideChange> LightOverrideChanged fires when the override changes. Its LightOverrideChange carries:

Field Holds
InputOverrideTransitionKind Transition Which kind of change. See Sources and Overrides
bool HadPreviousOverride Whether an override was present before
float PreviousValue What it was
InputOverrideOwnerKind PreviousOwnerKind How it was held before: None, Anonymous or Explicit
object PreviousOwner Who held it before. On a Vacated change this is a destroyed object: compare it, never use it
bool HasCurrentOverride Whether an override is present now
float CurrentValue What it is now
InputOverrideOwnerKind CurrentOwnerKind How it is held now
object CurrentOwner Who holds it now

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.