Sky

Sky creates a ready to go sky environment for your scenes.

Import

Sky is an add-on, and therefore must be imported explicitly. See Installation / Addons.

import { Sky } from 'three/addons/objects/Sky.js';

Code Example

const sky = new Sky();

sky.scale.setScalar( 450000 );

const phi = MathUtils.degToRad( 90 );

const theta = MathUtils.degToRad( 180 );

const sunPosition = new Vector3().setFromSphericalCoords( 1, phi, theta );

sky.material.uniforms.sunPosition.value = sunPosition;

scene.add( sky );

Examples

misc / objects / Sky

Constructor

Sky()

Create a new Sky instance.

Properties

Sky instance is a Mesh with a pre-defined ShaderMaterial, so every property described here should be set using Uniforms.

.turbidity : Number

Haziness of the Sky.

.rayleigh : Number

For a more detailed explanation see: Rayleigh scattering .

.mieCoefficient : Number

Mie scattering amount.

.mieDirectionalG : Number

Mie scattering direction.

.sunPosition : Vector3

The position of the sun.

.up : Vector3

The sun’s elevation from the horizon, in degrees.

Leave a comment

Your email address will not be published. Required fields are marked *