Back to Aframe

A Light

docs/primitives/a-light.md

1.7.11.8 KB
Original Source

A light changes the lighting and shading of the scene.

Examples

html
<!-- Red directional light shining from the top left. -->
<a-light color="red" position="-1 1 0"></a-light>

<!-- Blue point light, 5 meters in the air. -->
<a-light type="point" color="blue" position="0 5 0"></a-light>

<!-- Dim ambient lighting. -->
<a-light type="ambient" color="#222"></a-light>

<!-- Probe light using the #pisa environment map -->
<a-assets>
	<a-cubemap id="pisa">
	
	
	
	
	
	
	</a-cubemap>
</a-assets>

<a-light type="probe" envMap="#pisa"></a-light>

Attributes

AttributeComponent MappingDefault Value
anglelight.angle60
colorlight.color#fff
decaylight.decay1
distancelight.distance0.0
envmaplight.envMapnull
ground-colorlight.groundColor#fff
intensitylight.intensity1.0
penumbralight.penumbra0.0
typelight.typedirectional
targetlight.targetnull

Differences with the Default Lighting

When we add a light, A-Frame will remove the default lighting setup (i.e., one directional light from the top-left, and one small ambient light).