[name]为你的场景创建了一个准备就绪的天空环境。
[name] 是一个插件,因此必须明确导入。 参见[link:#manual/introduction/Installation Installation / Addons].
import { Sky } from 'three/addons/objects/Sky.js';
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 );
[example:webgl_shaders_sky misc / objects / Sky ]
创建一个[name]实例。
[name]实例是一个带有预定义的 [page:ShaderMaterial]材质的[page:Mesh]模型, 因此这里描述的每个属性都应该使用[page:Uniform]s.
[name]的浑浊度
更详细的解释参见: [link:https://en.wikipedia.org/wiki/Rayleigh_scattering Rayleigh scattering] .
[link:https://en.wikipedia.org/wiki/Mie_scattering Mie scattering]数量。
[link:https://en.wikipedia.org/wiki/Mie_scattering Mie scattering]方向
太阳的位置。
太阳从地平线升起的角度,以度为单位。
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Sky.js examples/jsm/objects/Sky.js]