Sky
Updated
Cheap procedural atmosphere sky.
- Type
comp-sky- Script class
SkyComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Environment and sky: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
azimuth |
||
distance |
0 < x ≤ 100000 |
|
elevation |
||
exposure |
0 ≤ x ≤ 100 |
|
mie |
0 ≤ x ≤ 1 |
|
mie |
0 ≤ x ≤ 1 |
|
rayleigh |
0 ≤ x ≤ 64 |
|
turbidity |
0 ≤ x ≤ 1000 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Move the sun of a procedural skyThe cheap procedural Sky, with a sun disc: the script steps the sun's elevation from morning to a low sunset and back, raising the haze near the horizon, and aims the Sun light along `sunDirection`.
Watch the sky redden as the sun sinks to the horizon, then rise again. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(SkyComponent); if (component) log(component.props);}