Back to Aframe

A Sky

docs/primitives/a-sky.md

1.7.11.9 KB
Original Source

The sky primitive adds a background color or 360° image to a scene. A sky is a large sphere with a color or texture mapped to the inside.

Example

An equirectangular image as a background:

html
<a-scene>
  <a-assets>
    
  </a-assets>
  <a-sky src="#sky"></a-sky>
</a-scene>

A plain color as a background:

html
<a-sky color="#6EBAA7"></a-sky>

Attributes

AttributeComponent MappingDefault Value
colormaterial.color#FFF
metalnessmaterial.metalness0
opacitymaterial.opacity1
phi-lengthgeometry.phiLength360
phi-startgeometry.phiStart0
radiusgeometry.radius500
repeatmaterial.repeatNone
roughnessmaterial.roughness0.5
segments-heightgeometry.segmentsHeight32
segments-widthgeometry.segmentsWidth64
shadermaterial.shaderflat
sidematerial.sideback
srcmaterial.srcNone
theta-lengthgeometry.thetaLength180
theta-startgeometry.thetaStart0
transparentmaterial.transparentfalse

Equirectangular Image

To be seamless, images should be equirectangular. We can find some sample equirectangular images on Flickr. To take an equirectangular photo, check out this 360-degree photography guide.