The LightingEstimation
module encapsulates access to estimations of lighting in the scene.
//==============================================================================
// The following example demonstrates how to bind the frame brightness property
// to the intensity of a light.
//
// Project setup:
// - Insert a plane
// - Add the 'Frame Brightness' capability
// - (Recommended) Remove the directional light
//==============================================================================
// Load in the required modules
const LightingEstimation = require('LightingEstimation');
const Reactive = require('Reactive');
const Scene = require('Scene');
// Locate the ambientLight in the Scene
const ambientLight = Scene.root.find('ambientLight0');
// Calculate light intensity by subtracting the frame brightness from 1, the
// darker the frame brightness, the greater the light intensity
const lightIntensity = Reactive.sub(1,LightingEstimation.frameBrightness);
// Bind the light intensity to the intensity of the ambient light
ambientLight.intensity = lightIntensity;
Property | Description |
---|---|
frameBrightness
|
Specifies a number that represents the brightness of the frame. |
This module exposes no methods.
This module exposes no classes.