LightSource
Lens Studio v1.0.0+
Scripting Name: Component.LightSource
Inherits from Component
Description
Acts as a source of light in the scene. See the Light and Shadows guide for more information about lighting.
Properties
autoLightSourcePosition
: Boolean
If enabled, the LightSource will be automatically positioned based on its orientation relative to any shadow casting meshes in the scene.
autoShadowFrustumSize
: Boolean
If enabled, shadowFrustumSize
will be automatically updated based on its orientation relative to any shadow casting meshes in the scene.
castsShadows
: Boolean
If enabled, the LightSource will be able to cast shadows.
color
: vec3
The color of the light.
diffuseEnvmapTexture
: Texture
A color image applied to an imaginary skybox the LightSource will use for color information.
envmapExposure
: Number
A value used to increase the intensity of light information derived from the diffuseEnvmapTexture
exponentially.
envmapRotation
: Number
Controls the amount of rotation applied to the diffuseEnvmapTexture
.
intensity
: Number
The strength of the light on a scale of 0.0 – 1.0.
renderLayer
: LayerSet
The set of layers this LightSource will affect.
shadowBlurRadius
: Number
Controls the blurring size used when casting shadows from this LightSource.
shadowColor
: vec4
Controls the color used when casting shadows from this LightSource.
shadowDensity
: Number
The lightness and darkness value of the shadow cast by objects from this light source.
shadowFrustumFarClipPlane
: Number
The maximum distance at which shadows will be calculated for this LightSource.
shadowFrustumNearClipPlane
: Number
The minimum distance at which shadows will be calculated for this LightSource.
shadowFrustumSize
: Number
The simulated distance of the light source from objects to calculate the softness of the shadow.
specularEnvmapTexture
: Texture
A color image applied to an imaginary skybox the light source will use for specular and reflection information.
useEnvmap
: Boolean
Enable if you would like the LightSource to use information from the diffuseEnvmapTexture
for light color information.
Inherited Methods
destroy()
: void
Destroys the component.
getSceneObject()
: SceneObject
Returns the SceneObject the component is attached to.
getTransform()
: Transform
Returns the Transform this component is attached to.
isSame(SerializableWithUID other)
: Boolean
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Inherited Properties
enabled
: Boolean
If disabled, the Component will stop enacting its behavior.
Examples
// Sets the intensity of a light source
//@input Component.LightSource lightSource
script.lightSource.intensity = 0.0;
Still Looking for help?
Visit Support