diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-08-13 11:48:21 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 11:48:21 -0300 |
commit | d84b28b94f26db0ea115baf92662b09e6d6db67b (patch) | |
tree | a5a9d4a388b9913d098d058f06547de51e8dfeeb /scene/resources/environment.h | |
parent | 64d859df0c6ba51ea4c4841e0a1eb287c5079eae (diff) | |
parent | 079ca220e14669ef7c31c399985cd2c733af15bd (diff) |
Merge pull request #41213 from reduz/volumetric-fog
Added volumetric fog effect.
Diffstat (limited to 'scene/resources/environment.h')
-rw-r--r-- | scene/resources/environment.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scene/resources/environment.h b/scene/resources/environment.h index f334d22115..6edb54b187 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -97,6 +97,13 @@ public: GLOW_BLEND_MODE_MIX, }; + enum VolumetricFogShadowFilter { + VOLUMETRIC_FOG_SHADOW_FILTER_DISABLED, + VOLUMETRIC_FOG_SHADOW_FILTER_LOW, + VOLUMETRIC_FOG_SHADOW_FILTER_MEDIUM, + VOLUMETRIC_FOG_SHADOW_FILTER_HIGH, + }; + private: RID environment; @@ -196,6 +203,17 @@ private: float fog_height_curve = 1.0; void _update_fog_height(); + // Volumetric Fog + bool volumetric_fog_enabled = false; + float volumetric_fog_density = 0.01; + Color volumetric_fog_light = Color(0.0, 0.0, 0.0); + float volumetric_fog_light_energy = 1.0; + float volumetric_fog_length = 64.0; + float volumetric_fog_detail_spread = 2.0; + VolumetricFogShadowFilter volumetric_fog_shadow_filter = VOLUMETRIC_FOG_SHADOW_FILTER_LOW; + float volumetric_fog_gi_inject = 0.0; + void _update_volumetric_fog(); + // Adjustment bool adjustment_enabled = false; float adjustment_brightness = 1.0; @@ -375,6 +393,24 @@ public: void set_fog_height_curve(float p_distance); float get_fog_height_curve() const; + // Volumetric Fog + void set_volumetric_fog_enabled(bool p_enable); + bool is_volumetric_fog_enabled() const; + void set_volumetric_fog_density(float p_density); + float get_volumetric_fog_density() const; + void set_volumetric_fog_light(Color p_color); + Color get_volumetric_fog_light() const; + void set_volumetric_fog_light_energy(float p_begin); + float get_volumetric_fog_light_energy() const; + void set_volumetric_fog_length(float p_length); + float get_volumetric_fog_length() const; + void set_volumetric_fog_detail_spread(float p_detail_spread); + float get_volumetric_fog_detail_spread() const; + void set_volumetric_fog_shadow_filter(VolumetricFogShadowFilter p_filter); + VolumetricFogShadowFilter get_volumetric_fog_shadow_filter() const; + void set_volumetric_fog_gi_inject(float p_gi_inject); + float get_volumetric_fog_gi_inject() const; + // Adjustment void set_adjustment_enabled(bool p_enabled); bool is_adjustment_enabled() const; @@ -399,5 +435,6 @@ VARIANT_ENUM_CAST(Environment::SSAOBlur) VARIANT_ENUM_CAST(Environment::SDFGICascades) VARIANT_ENUM_CAST(Environment::SDFGIYScale) VARIANT_ENUM_CAST(Environment::GlowBlendMode) +VARIANT_ENUM_CAST(Environment::VolumetricFogShadowFilter) #endif // ENVIRONMENT_H |