Capítulo 599 de 859

Chapter 599: Sky

Core Idea

Represents a skydome for scene backgrounds. Based on A Practical Analytic Model for Daylight aka The Preetham Model, the de facto standard for analytical skydomes.

Note that this class can only be used with WebGLRenderer. When using WebGPURenderer, use SkyMesh.

More references:

const sky = new Sky();
sky.scale.setScalar( 10000 );
scene.add( sky );

It can be useful to hide the sun disc when generating an environment map to avoid artifacts

// disable before rendering environment map
sky.material.uniforms.showSunDisc.value = false;
// ...
// re-enable before scene sky box rendering
sky.material.uniforms.showSunDisc.value = true;

Key Concepts

  • isSky : boolean (readonly): This flag can be used for type testing.

Code Examples

import { Sky } from 'three/addons/objects/Sky.js';
  • What it demonstrates: Typical usage of Sky.

Reference Tables

Constructor

Signature
new Sky()

Properties

PropertyDescription
.isSky : boolean (readonly)This flag can be used for type testing.

Key Takeaways

  1. Sky extends: EventDispatcher → Object3D → Mesh
  2. Most relevant properties: isSky.

Connects To