|
Unravel Engine C++ Reference
|
Class that contains sky light data. More...
#include <light_component.h>
Public Types | |
| enum class | sky_mode { reserved_0 = 0 , perez = 1 , skybox = 2 } |
| Enumeration for sky modes. More... | |
| enum class | irradiance_quality { flat , directional } |
| Directional variation of the indirect diffuse ambient. More... | |
| enum class | cloud_mode { none = 0 , flat = 1 , volumetric = 2 } |
Public Types inherited from unravel::component_crtp< skylight_component > | |
| using | base |
Public Member Functions | |
| auto | get_mode () const noexcept -> const sky_mode & |
| Gets the current sky mode. | |
| void | set_mode (const sky_mode &mode) |
| Sets the sky mode. | |
| auto | get_turbidity () const noexcept -> float |
| Gets the current turbidity value. | |
| void | set_turbidity (float turbidity) |
| Sets the turbidity value. | |
| auto | get_cloud_mode () const noexcept -> cloud_mode |
| Gets the cloud rendering mode. | |
| void | set_cloud_mode (cloud_mode mode) |
| Sets the cloud rendering mode. | |
| auto | get_cloud_coverage () const noexcept -> float |
| Gets the cloud coverage value. | |
| void | set_cloud_coverage (float coverage) |
| Sets the cloud coverage value. | |
| auto | get_cloud_base_altitude () const noexcept -> float |
| Gets the cloud base altitude in world units. | |
| void | set_cloud_base_altitude (float altitude) |
| Sets the cloud base altitude. | |
| auto | get_cloud_top_altitude () const noexcept -> float |
| Gets the cloud top altitude in world units (volumetric slab top). | |
| void | set_cloud_top_altitude (float altitude) |
| Sets the cloud top altitude. Must be greater than base altitude. | |
| auto | get_cloud_speed () const noexcept -> float |
| Gets the cloud speed multiplier. | |
| void | set_cloud_speed (float speed) |
| Sets the cloud speed multiplier. | |
| auto | get_cloud_density () const noexcept -> float |
| Gets the cloud density multiplier. | |
| void | set_cloud_density (float density) |
| Sets the cloud density multiplier. | |
| auto | get_cloud_absorption () const noexcept -> float |
| Gets the cloud absorption coefficient (Beer-Lambert extinction). | |
| void | set_cloud_absorption (float absorption) |
| Sets the cloud absorption coefficient. | |
| auto | get_cloud_light_absorption () const noexcept -> float |
| Gets the cloud light absorption (self-shadow strength). | |
| void | set_cloud_light_absorption (float absorption) |
| Sets the cloud light absorption (self-shadow strength). | |
| auto | get_cloud_vol_uv_scale () const noexcept -> float |
| Volumetric cloud shape: world-to-noise UV scale (smaller = larger features). | |
| void | set_cloud_vol_uv_scale (float scale) |
| auto | get_cloud_vol_edge_width () const noexcept -> float |
| Volumetric cloud shape: smoothstep edge width for the density mask. | |
| void | set_cloud_vol_edge_width (float width) |
| auto | get_cloud_vol_shape_power () const noexcept -> float |
| Volumetric cloud shape: contrast on the density mask (pow exponent). | |
| void | set_cloud_vol_shape_power (float power) |
| auto | get_cloud_vol_detail_erode () const noexcept -> float |
| Volumetric cloud shape: Worley detail erosion strength. | |
| void | set_cloud_vol_detail_erode (float erode) |
| auto | get_cloud_vol_macro_strength () const noexcept -> float |
| Volumetric cloud shape: macro Worley threshold jitter (clearings vs sheet). | |
| void | set_cloud_vol_macro_strength (float strength) |
| auto | get_cloud_vol_coarse_scale () const noexcept -> float |
| Volumetric cloud shape: coarse noise sample scale (larger masses). | |
| void | set_cloud_vol_coarse_scale (float scale) |
| auto | get_cloud_vol_base_mix () const noexcept -> float |
| Volumetric cloud shape: blend between coarse and fine base noise. | |
| void | set_cloud_vol_base_mix (float mix) |
| auto | get_cloud_vol_sun_intensity () const noexcept -> float |
| Volumetric cloud lighting: sun contribution multiplier in the cloud integrator. | |
| void | set_cloud_vol_sun_intensity (float intensity) |
| auto | get_irradiance_intensity () const noexcept -> float |
| Gets the irradiance intensity (strength of indirect diffuse). | |
| void | set_irradiance_intensity (float intensity) |
| Sets the irradiance intensity. | |
| auto | get_irradiance_tint () const noexcept -> const math::color & |
| Gets the optional irradiance tint override (default from sky when white). | |
| void | set_irradiance_tint (const math::color &color) |
| Sets the irradiance tint override. | |
| auto | get_irradiance_quality () const noexcept -> irradiance_quality |
| Gets the irradiance quality for indirect diffuse. | |
| void | set_irradiance_quality (irradiance_quality quality) |
| Sets the irradiance quality. | |
| auto | get_irradiance_use_sky () const noexcept -> bool |
| Gets whether the sky color contributes to the ambient irradiance. | |
| void | set_irradiance_use_sky (bool use_sky) |
| Sets whether the sky color contributes to the ambient irradiance. | |
| auto | get_sky_brightness () const noexcept -> float |
| Gets the sky brightness multiplier (affects atmospheric pass and irradiance). | |
| void | set_sky_brightness (float brightness) |
| Sets the sky brightness multiplier. | |
| auto | get_cubemap () const noexcept -> const asset_handle< gfx::texture > & |
| void | set_cubemap (const asset_handle< gfx::texture > &cubemap) |
| auto | get_cloud_time () const noexcept -> float |
| Gets the accumulated time for cloud animation. | |
| void | update (delta_t dt) |
Public Member Functions inherited from unravel::basic_component | |
| void | touch () |
| Marks the component as 'touched'. | |
Additional Inherited Members | |
Public Attributes inherited from unravel::basic_component | |
| bool | eto {} |
| Disable empty type optimizations. | |
Static Public Attributes inherited from unravel::component_crtp< skylight_component > | |
| static constexpr bool | in_place_delete |
| Indicates if the component can be deleted in place. | |
Class that contains sky light data.
Definition at line 82 of file light_component.h.
|
strong |
| Enumerator | |
|---|---|
| none | No clouds rendered. |
| flat | Flat projected clouds (cheap, single-sample scattering) |
| volumetric | Volumetric raymarched clouds (full scattering, half-res with temporal) |
Definition at line 113 of file light_component.h.
|
strong |
Directional variation of the indirect diffuse ambient.
| Enumerator | |
|---|---|
| flat | Flat ambient: only the constant SH band (L0) is written, same color for every normal. |
| directional | Directional ambient: full L0-L2 spherical harmonics, varies with the surface normal. |
Definition at line 105 of file light_component.h.
|
strong |
Enumeration for sky modes.
| Enumerator | |
|---|---|
| reserved_0 | Reserved sky mode. |
| perez | Perez sky mode. |
| skybox | Skybox. |
Definition at line 89 of file light_component.h.
|
noexcept |
Gets the cloud absorption coefficient (Beer-Lambert extinction).
Definition at line 214 of file light_component.cpp.
|
noexcept |
Gets the cloud base altitude in world units.
Definition at line 174 of file light_component.cpp.
|
noexcept |
Gets the cloud coverage value.
Definition at line 164 of file light_component.cpp.
|
noexcept |
Gets the cloud density multiplier.
Definition at line 204 of file light_component.cpp.
|
noexcept |
Gets the cloud light absorption (self-shadow strength).
Definition at line 224 of file light_component.cpp.
|
noexcept |
Gets the cloud rendering mode.
Definition at line 154 of file light_component.cpp.
|
noexcept |
Gets the cloud speed multiplier.
Definition at line 194 of file light_component.cpp.
|
inlinenoexcept |
Gets the accumulated time for cloud animation.
Definition at line 365 of file light_component.h.
|
noexcept |
Gets the cloud top altitude in world units (volumetric slab top).
Definition at line 184 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: blend between coarse and fine base noise.
Definition at line 294 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: coarse noise sample scale (larger masses).
Definition at line 284 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: Worley detail erosion strength.
Definition at line 264 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: smoothstep edge width for the density mask.
Definition at line 244 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: macro Worley threshold jitter (clearings vs sheet).
Definition at line 274 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: contrast on the density mask (pow exponent).
Definition at line 254 of file light_component.cpp.
|
noexcept |
Volumetric cloud lighting: sun contribution multiplier in the cloud integrator.
Definition at line 304 of file light_component.cpp.
|
noexcept |
Volumetric cloud shape: world-to-noise UV scale (smaller = larger features).
Definition at line 234 of file light_component.cpp.
|
inlinenoexcept |
Definition at line 352 of file light_component.h.
|
noexcept |
Gets the irradiance intensity (strength of indirect diffuse).
Definition at line 314 of file light_component.cpp.
|
noexcept |
Gets the irradiance quality for indirect diffuse.
Definition at line 334 of file light_component.cpp.
|
noexcept |
Gets the optional irradiance tint override (default from sky when white).
Definition at line 324 of file light_component.cpp.
|
noexcept |
Gets whether the sky color contributes to the ambient irradiance.
Definition at line 344 of file light_component.cpp.
|
noexcept |
Gets the current sky mode.
Definition at line 135 of file light_component.cpp.
|
noexcept |
Gets the sky brightness multiplier (affects atmospheric pass and irradiance).
Definition at line 354 of file light_component.cpp.
|
noexcept |
Gets the current turbidity value.
Definition at line 144 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_absorption | ( | float | absorption | ) |
Sets the cloud absorption coefficient.
| [in] | absorption | The absorption to set, in the range [0.01, 0.5]. |
Definition at line 219 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_base_altitude | ( | float | altitude | ) |
Sets the cloud base altitude.
| [in] | altitude | The cloud base altitude to set, in world units. |
Definition at line 179 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_coverage | ( | float | coverage | ) |
Sets the cloud coverage value.
| [in] | coverage | The cloud coverage value to set, in the range 0.0f-1.0f. |
Definition at line 169 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_density | ( | float | density | ) |
Sets the cloud density multiplier.
| [in] | density | The cloud density multiplier to set. |
Definition at line 209 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_light_absorption | ( | float | absorption | ) |
Sets the cloud light absorption (self-shadow strength).
| [in] | absorption | The light absorption to set, in the range [0.01, 0.5]. |
Definition at line 229 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_mode | ( | cloud_mode | mode | ) |
Sets the cloud rendering mode.
| [in] | mode | The cloud mode to set. |
Definition at line 159 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_speed | ( | float | speed | ) |
Sets the cloud speed multiplier.
| [in] | speed | The cloud speed multiplier to set. |
Definition at line 199 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_top_altitude | ( | float | altitude | ) |
Sets the cloud top altitude. Must be greater than base altitude.
| [in] | altitude | The cloud top altitude to set, in world units. |
Definition at line 189 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_base_mix | ( | float | mix | ) |
Definition at line 299 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_coarse_scale | ( | float | scale | ) |
Definition at line 289 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_detail_erode | ( | float | erode | ) |
Definition at line 269 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_edge_width | ( | float | width | ) |
Definition at line 249 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_macro_strength | ( | float | strength | ) |
Definition at line 279 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_shape_power | ( | float | power | ) |
Definition at line 259 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_sun_intensity | ( | float | intensity | ) |
Definition at line 309 of file light_component.cpp.
| void unravel::skylight_component::set_cloud_vol_uv_scale | ( | float | scale | ) |
Definition at line 239 of file light_component.cpp.
|
inline |
Definition at line 356 of file light_component.h.
| void unravel::skylight_component::set_irradiance_intensity | ( | float | intensity | ) |
Sets the irradiance intensity.
| [in] | intensity | The irradiance intensity to set. |
Definition at line 319 of file light_component.cpp.
| void unravel::skylight_component::set_irradiance_quality | ( | irradiance_quality | quality | ) |
Sets the irradiance quality.
| [in] | quality | The irradiance quality to set. |
Definition at line 339 of file light_component.cpp.
| void unravel::skylight_component::set_irradiance_tint | ( | const math::color & | color | ) |
Sets the irradiance tint override.
| [in] | color | The irradiance tint to set (white = use sky-derived color). |
Definition at line 329 of file light_component.cpp.
| void unravel::skylight_component::set_irradiance_use_sky | ( | bool | use_sky | ) |
Sets whether the sky color contributes to the ambient irradiance.
| [in] | use_sky | true to tint the ambient by the sky/environment color, false to use only the irradiance tint as a flat artist-defined ambient (sky ignored). |
Definition at line 349 of file light_component.cpp.
| void unravel::skylight_component::set_mode | ( | const sky_mode & | mode | ) |
Sets the sky mode.
| [in] | mode | The sky mode to set. |
Definition at line 139 of file light_component.cpp.
| void unravel::skylight_component::set_sky_brightness | ( | float | brightness | ) |
Sets the sky brightness multiplier.
| [in] | brightness | The sky brightness to set (1.0 = neutral, >1 brighter, <1 darker). |
Definition at line 359 of file light_component.cpp.
| void unravel::skylight_component::set_turbidity | ( | float | turbidity | ) |
Sets the turbidity value.
| [in] | turbidity | The turbidity value to set, in the range 1.9f-10.0f. |
Definition at line 149 of file light_component.cpp.
|
inline |
Definition at line 370 of file light_component.h.