Note: This documentation is for the old 0.8.0 version of A-Frame. Check out the documentation for the current 1.5.0 version
The shadow component enables shadows for an entity and its children. Receiving shadows from surrounding objects and casting shadows onto other objects may (and often should) be enabled independently.
Without this component, an entity will not cast nor receive shadows.
The example below configures a tree model to cast shadows onto the surrounding scene but not receive shadows itself.
<a-entity light="type:directional; castShadow:true;" position="1 1 1"></a-entity>
IMPORTANT: Adding the
shadow component alone is not enough to display
shadows in your scene. We must have at least one light with
true enabled. Additionally, the light’s shadow camera (used for depth
projection) usually must be configured correctly. Refer to the light
component for more information.
|Whether the entity casts shadows onto the surrounding scene.
|Whether the entity receives shadows from the surrounding scene.
The shadow system exposes scene-level properties for configuring the renderer
for shadows. These are set on
|Whether to dynamically update the shadow map every frame. Disable and manually update by setting
renderer.shadowMap.needsUpdate = true for best performance. Calculating shadow maps is expensive.
|Shadow type. One of
pcf (percentage closer filtering)
|Whether to render the opposite side as specified by the material into the shadow map.
|Whether to treat materials specified as double-sided as if they were specified as front-sided when rendering the shadow map.