ViroAmbientLight

A light object that emits ambient light that affects all objects equally. See our [Lighting and Material Guide]https://viro-community.readme.io/docs/lighting-and-materials) for more information on lights in a scene.

Example use:
<ViroAmbientLight color="#ffffff" />

Props

color

TypeDescription
ColorPropTypeThe color of the light. The default light color is white. Valid color formats are:

- '#f0f' (#rgb)
- '#f0fc' (#rgba)
- '#ff00ff' (#rrggbb)
- '#ff00ff00' (#rrggbbaa)
- 'rgb(255, 255, 255)'
- 'rgba(255, 255, 255, 1.0)'
- 'hsl(360, 100%, 100%)'
- 'hsla(360, 100%, 100%, 1.0)'
- 'transparent'
- 'red'
- 0xff00ff00 (0xrrggbbaa)

See Styles for more.

influenceBitMask

TypeDescription
numberThis property is used to make lights apply to specific nodes. Lights and nodes in the scene can be assigned bit-masks to determine how each light influences each node. During rendering, Viro compares each light's influenceBitMask with each node's lightReceivingBitMask and shadowCastingBitMask. The bit-masks are compared using a bitwise AND operation:

If (influenceBitMask & lightReceivingBitMask) != 0, then the light will illuminate the node (and the node will receive shadows cast from objects occluding the light).

If (influenceBitMask & shadowCastingBitMask) != 0, then the node will cast shadows from the light.

The default mask is 0x1.

intensity

TypeDescription
numberThe brightness of the light. Set to 1000 for normal intensity. The intensity is simply divided by 1000 and multiplied by the light's color.

Lower intensities will decrease the brightness of the light, and higher intensities will increase the brightness of the light.

The default intensity is 1000.

temperature

TypeDescription
numberThe temperature of the light, in Kelvin. Viro will derive a hue from this temperature and multiply it by the light's color. To model a physical light with a known temperature, you can leave the color of this Light set to (1.0, 1.0, 1.0) and set its temperature only.

The default value for temperature is 6500K, which represents pure white light.

rotation

TypeDescription
numberThe rotation of the component around it's local axis specified as Euler angles [x, y, z]. Units for each angle are specified in degrees.

style

TypeDescription
StylesStyles of the component.

transformBehaviors

TypeDescription
string[]An array of transform constraints that affect the transform of the object. For example, putting the value "billboard" will ensure the box is facing the user as the user rotates their head on any axis. This is useful for icons or text where you'd like the box to always face the user at a particular rotation. Allowed values(values are case sensitive):

"billboard": Billboard object on x,y,z axis "billboardX": Billboard object on the x axis
"billboardY": Billboard object on the y axis
"billboardZ": Billboard object on the z axis

width

TypeDescription
numberThe width of the component in 3D space. Default value is 1.

visible

TypeDescription
booleanFalse if the box should be hidden. By default the box is visible and this value is true.

Methods

setNativeProps(nativeProps)

A wrapper function around the native component's setNativeProps which allow users to set values on the native component without changing state/setting props and re-rendering. Refer to the React Native documentation on Direct Manipulation for more information.

ParameterTypeDescription
nativePropsobjectan object where the keys are the properties to set and the values are the values to set
componentRef.setNativeProps({ position: [0, 0, -1] });