HDSky¶
Enumerations¶
- HDCloudsRenderMode¶
Rendering mode for volumetric clouds.
- Values:
Panorama = 0 - The sky will be pre-rendered into a panorama. Applying it each frame is much cheaper than performing full volumetric rendering. It’s a good option when the camera in your game isn’t going to fly through the clouds or at large distances. This is the default mode.
Volumetric = 1 - Full volumetric rendering of the clouds. It’s a good but costly option for when the clouds are part of your scene and not only background.
- HDStrataCloudsType¶
Shape type of stratosphere clouds.
- Values:
Simple = 0 - Simple stratosphere clouds.
FeatherSparse = 1 - Feather-shaped sparse stratosphere clouds.
FeatherDense = 2 - Feather-shaped dense stratosphere clouds.
Classes¶
- HDSky : NativeComponent¶
This component provides control over sky properties in HD Renderer.
The sky in HD Renderer simulates planetary atmosphere and clouds based on Earth atmosphere properties. So the default settings represent a clear day with a blue sky and some clouds, although they can be tweaked to get broad range of different looks. Read field descriptions for details.
You can use a node with HD Renderer component in it to set the panorama center or an offset for clouds.
To use this component, add the following line to your project file:
require engine.core_components.hd_sky_component // or require engine.core
Usage example:
let renderSettings = create_render_settings()
add_component(renderSettings, new HDSky())
get_component(renderSettings) $(var sky : HDSky?) {
sky.atmosphere.mediaDensity = 0.3
sky.atmosphere.atmosphereTint = float3(0.7, 0.85, 1.0)
sky.clouds.layers[0].startHeight = 0.5
let secondLayerHandle = sky.clouds.layers.push()
secondLayerHandle.startHeight = 1.5
secondLayerHandle.thickness = 6.0
secondLayerHandle.coverage = 0.5
}
- Properties:
- HDSky.clouds: HDCloudsHandle¶
Settings for cloud formation and lighting.
- HDSky.atmosphere: HDAtmosphereHandle¶
Settings for atmosphere fog and sky appearance.
The atmospheric fog is controlled by the Mie scattering medium (aerosols like dust or liquid droplets) and Rayleigh scattering medium (air molecules). The aerosol medium acts as a ground-level distance fog that can be used to simulate different weather conditions, while the Rayleigh medium affects the overall appearance of the distant sky. Also atmosphere parameters are set relative to Earth’s atmosphere properties. So default ones represent a clear day with a blue sky.
- HDSky.customSky: MaterialId¶
- HDSky.customSky =(value: MaterialId)¶
Allows setting a custom material as a sky source.
- Arguments:
value : MaterialId
Structures¶
- HDCloudsHandle¶
Handle to the clouds field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- Properties:
- HDCloudsHandle.seed: int¶
- HDCloudsHandle.seed =(value: int)¶
Random seed for the clouds pattern. By default it’s -1, which means the seed is generated randomly for each game launch.
- Arguments:
value : int
- HDCloudsHandle.renderMode: HDCloudsRenderMode¶
- HDCloudsHandle.renderMode =(value: HDCloudsRenderMode)¶
Rendering mode for volumetric clouds. See HDCloudsRenderMode enum description for details.
- Arguments:
value : HDCloudsRenderMode
- HDCloudsHandle.layers: HDCloudsLayersHandle¶
Settings for up to two independent cloud layers. Each layer controls the form of the clouds within its range with shapes blending where they intersect. By default one layer is used.
- HDCloudsHandle.form: HDCloudsFormHandle¶
Shape and formation properties shared across all cloud layers.
- HDCloudsHandle.lighting: HDCloudsLightingHandle¶
Lighting properties of the clouds.
- HDCloudsLayersHandle¶
Handle to the clouds.layers field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- HDCloudsLayersHandle.length(): int¶
Returns the number of elements in the array.
- HDCloudsLayersHandle.push(): HDCloudsLayerHandle¶
Appends an element to the end of the array and returns a handle to it.
- HDCloudsLayersHandle.pop()¶
Removes the last element from the array.
- HDCloudsLayersHandle.clear()¶
Removes all elements from the array.
- HDCloudsLayersHandle.insert(pos: int): HDCloudsLayerHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- HDCloudsLayersHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- HDCloudsLayersHandle.[](index: int): HDCloudsLayerHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- HDCloudsLayerHandle¶
Handle to the i-th element of the clouds.layers field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
clouds.layersfield of the component.
- Properties:
- HDCloudsLayerHandle.startHeight: float¶
- HDCloudsLayerHandle.startHeight =(value: float)¶
Altitude in kilometers at which the cloud layer begins.
- Arguments:
value : float
- HDCloudsLayerHandle.thickness: float¶
- HDCloudsLayerHandle.thickness =(value: float)¶
Vertical extent of the cloud layer in kilometers. It works as a scaling factor and as a height extent for clouds volumetric textures. The actual thickness of clouds highly depends on other parameters provided in here.
- Arguments:
value : float
- HDCloudsLayerHandle.density: float¶
- HDCloudsLayerHandle.density =(value: float)¶
Optical density of the clouds in range [0, 1]. Higher values produce thicker, more opaque clouds with sharper light gradients.
- Arguments:
value : float
- HDCloudsLayerHandle.coverage: float¶
- HDCloudsLayerHandle.coverage =(value: float)¶
Fraction of the sky covered by clouds in range [0, 1]. At 0 the sky is clear; at 1 clouds fill the entire layer.
- Arguments:
value : float
- HDCloudsLayerHandle.volume: float¶
- HDCloudsLayerHandle.volume =(value: float)¶
Cloud shape type in range [0, 1]. Low values produce thin, wispy clouds; high values produce tall, dense cumuliform clouds.
- Arguments:
value : float
- HDCloudsLayerHandle.volumeVariance: float¶
- HDCloudsLayerHandle.volumeVariance =(value: float)¶
Spatial variation in cloud shape type across the layer in range [0, 1]. Higher values mix thin and dense cloud forms within the same layer.
- Arguments:
value : float
- HDCloudsLayerHandle.frequency: float¶
- HDCloudsLayerHandle.frequency =(value: float)¶
Horizontal spatial frequency of cloud cells. Lower values produce larger, widely-spaced clouds; higher values produce smaller, denser patterns.
- Arguments:
value : float
- HDCloudsFormHandle¶
Handle to the clouds.form field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- Properties:
- HDCloudsFormHandle.extinction: float¶
- HDCloudsFormHandle.extinction =(value: float)¶
Extinction coefficient controlling how opaque cloud matter is in range [0, 1]. Lower values let more light pass through, producing thin translucent clouds. Higher values create dense, shadowed interiors.
- Arguments:
value : float
- HDCloudsFormHandle.shapeNoiseScale: float¶
- HDCloudsFormHandle.shapeNoiseScale =(value: float)¶
Base scale of the 3D noise used to shape cloud boundaries. Higher values produce more detailed, fine-grained cloud edges.
- Arguments:
value : float
- HDCloudsFormHandle.erosionNoiseScale: float¶
- HDCloudsFormHandle.erosionNoiseScale =(value: float)¶
Scale of the high-frequency detail noise that erodes cloud boundaries. Higher values produce finer erosion.
- Arguments:
value : float
- HDCloudsFormHandle.epicness: float¶
- HDCloudsFormHandle.epicness =(value: float)¶
Controls the vertical development and drama of cloud shapes in range [0, 1]. At 0 clouds are flat and uniform; at 1 they develop pronounced vertical towers and anvil structures.
- Arguments:
value : float
- HDCloudsFormHandle.worldSize: float¶
- HDCloudsFormHandle.worldSize =(value: float)¶
Scale of the repeating weather pattern that determines where clouds form.
- Arguments:
value : float
- HDCloudsFormHandle.turbulenceStrength: float¶
- HDCloudsFormHandle.turbulenceStrength =(value: float)¶
Strength of wind turbulence applied to cloud shapes. You can set negative values to invert the swirling direction.
- Arguments:
value : float
- HDCloudsFormHandle.turbulenceFrequency: float¶
- HDCloudsFormHandle.turbulenceFrequency =(value: float)¶
Spatial frequency of the turbulence pattern. Higher values produce finer, more rapid swirling distortions.
- Arguments:
value : float
- HDCloudsFormHandle.cumulonimbusShapeScale: float¶
- HDCloudsFormHandle.cumulonimbusShapeScale =(value: float)¶
Shape noise scale used specifically for cumulonimbus (thunderstorm) clouds. Higher values produce more detailed storm cell structures.
- Arguments:
value : float
- HDCloudsFormHandle.cumulonimbusCoverage: float¶
- HDCloudsFormHandle.cumulonimbusCoverage =(value: float)¶
Fraction of the sky covered by cumulonimbus (thunderstorm) clouds in range [0, 1]. These are tall, anvil-shaped storm clouds added on top of the regular cloud layers.
- Arguments:
value : float
- HDCloudsFormHandle.strataAmount: float¶
- HDCloudsFormHandle.strataAmount =(value: float)¶
Density of the high-altitude strata cloud layer in range [0, 1]. Strata clouds are thin, sheet-like clouds at high altitude that add a subtle haze layer above the volumetric clouds.
- Arguments:
value : float
- HDCloudsFormHandle.strataAltitude: float¶
- HDCloudsFormHandle.strataAltitude =(value: float)¶
Altitude in kilometers of the strata cloud layer.
- Arguments:
value : float
- HDCloudsFormHandle.strataType: HDStrataCloudsType¶
- HDCloudsFormHandle.strataType =(value: HDStrataCloudsType)¶
Visual style of the strata cloud texture. See HDStrataCloudsType enum description for details.
- Arguments:
value : HDStrataCloudsType
- HDCloudsLightingHandle¶
Handle to the clouds.lighting field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- Properties:
- HDCloudsLightingHandle.ambientDesaturation: float¶
- HDCloudsLightingHandle.ambientDesaturation =(value: float)¶
Amount of desaturation applied to ambient light inside clouds in range [0, 1]. Reduces the colored-sky tint visible in shaded cloud interiors.
- Arguments:
value : float
- HDCloudsLightingHandle.msContribution: float¶
- HDCloudsLightingHandle.msContribution =(value: float)¶
Relative weight of higher-order multiple scattering bounces in range [0, 1]. Higher values brighten the overall cloud volume more uniformly, including lit faces. Lower values produce darker, more contrast-heavy clouds.
- Arguments:
value : float
- HDCloudsLightingHandle.msAttenuation: float¶
- HDCloudsLightingHandle.msAttenuation =(value: float)¶
Controls how quickly extinction decreases for successive scattering orders in range [0, 1]. Lower values allow multiply-scattered light to penetrate deeper into the cloud, brightening shadowed interiors and giving clouds a softer, more translucent appearance. Higher values keep the interior darker.
- Arguments:
value : float
- HDAtmosphereHandle¶
Handle to the atmosphere field of HDSky component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- Properties:
- HDAtmosphereHandle.groundColor: float3¶
- HDAtmosphereHandle.groundColor =(value: float3)¶
Average color (albedo) of the ground surface. Affects the color of light reflected from the ground back into the sky, visually affecting shadowed areas of the clouds and atmospheric fog.
- Arguments:
value : float3
- HDAtmosphereHandle.mediaTint: float3¶
- HDAtmosphereHandle.mediaTint =(value: float3)¶
Color tint of the aerosol medium (dust, moisture, pollution particles).
- Arguments:
value : float3
- HDAtmosphereHandle.mediaDensity: float¶
- HDAtmosphereHandle.mediaDensity =(value: float)¶
Density of aerosol particles in the atmosphere. Controls overall haziness: higher values produce thicker haze, stronger sun glow, and more attenuation of distant objects.
- Arguments:
value : float
- HDAtmosphereHandle.mediaAbsorption: float¶
- HDAtmosphereHandle.mediaAbsorption =(value: float)¶
How much the aerosol particles absorb light rather than scatter it. At 0 all attenuated light is scattered (bright milky haze). Higher values add absorption that darkens the medium without adding glow, and also reduces the directional sharpness of the sun halo.
- Arguments:
value : float
- HDAtmosphereHandle.mediaHeight: float¶
- HDAtmosphereHandle.mediaHeight =(value: float)¶
Controls how quickly aerosol density falls off with altitude. Lower values concentrate haze near the ground; higher values spread it higher up. The final value is additionally multiplied by atmosphereHeight.
- Arguments:
value : float
- HDAtmosphereHandle.atmosphereTint: float3¶
- HDAtmosphereHandle.atmosphereTint =(value: float3)¶
Color tint of the Rayleigh scattering medium (air molecules). Controls the color of the clear sky. Default white produces the natural blue sky.
- Arguments:
value : float3
- HDAtmosphereHandle.atmosphereDensity: float¶
- HDAtmosphereHandle.atmosphereDensity =(value: float)¶
Density of the Rayleigh scattering medium. Higher values produce a denser sky with more aerial perspective; lower values make it thinner and darker, approaching a space-like look.
- Arguments:
value : float
- HDAtmosphereHandle.atmosphereHeight: float¶
- HDAtmosphereHandle.atmosphereHeight =(value: float)¶
Controls how quickly atmosphere density falls off with altitude similar to the aerosol medium layer. Also multiplies mediaHeight.
- Arguments:
value : float
- HDAtmosphereHandle.ozoneImpact: float¶
- HDAtmosphereHandle.ozoneImpact =(value: float)¶
Influence of the ozone layer on sky color in range [0, 1]. The ozone layer absorbs yellow-green wavelengths, so higher values make the sky appear bluer at twilight.
- Arguments:
value : float