summaryrefslogtreecommitdiff
path: root/scene/resources/environment.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/environment.h')
-rw-r--r--scene/resources/environment.h101
1 files changed, 57 insertions, 44 deletions
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index f334d22115..d4d84f31aa 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;
@@ -177,24 +184,25 @@ private:
// Fog
bool fog_enabled = false;
- Color fog_color = Color(0.5, 0.6, 0.7);
- Color fog_sun_color = Color(1.0, 0.9, 0.7);
- float fog_sun_amount = 0.0;
- void _update_fog();
+ Color fog_light_color = Color(0.5, 0.6, 0.7);
+ float fog_light_energy = 1.0;
+ float fog_sun_scatter = 0.0;
+ float fog_density = 0.001;
+ float fog_height = 0.0;
+ float fog_height_density = 0.0; //can be negative to invert effect
- bool fog_depth_enabled = true;
- float fog_depth_begin = 10.0;
- float fog_depth_end = 100.0;
- float fog_depth_curve = 1.0;
- bool fog_transmit_enabled = false;
- float fog_transmit_curve = 1.0;
- void _update_fog_depth();
+ void _update_fog();
- bool fog_height_enabled = false;
- float fog_height_min = 10.0;
- float fog_height_max = 0.0;
- 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;
@@ -344,36 +352,40 @@ public:
float get_glow_hdr_luminance_cap() const;
// Fog
+
void set_fog_enabled(bool p_enabled);
bool is_fog_enabled() const;
- void set_fog_color(const Color &p_color);
- Color get_fog_color() const;
- void set_fog_sun_color(const Color &p_color);
- Color get_fog_sun_color() const;
- void set_fog_sun_amount(float p_amount);
- float get_fog_sun_amount() const;
-
- void set_fog_depth_enabled(bool p_enabled);
- bool is_fog_depth_enabled() const;
- void set_fog_depth_begin(float p_distance);
- float get_fog_depth_begin() const;
- void set_fog_depth_end(float p_distance);
- float get_fog_depth_end() const;
- void set_fog_depth_curve(float p_curve);
- float get_fog_depth_curve() const;
- void set_fog_transmit_enabled(bool p_enabled);
- bool is_fog_transmit_enabled() const;
- void set_fog_transmit_curve(float p_curve);
- float get_fog_transmit_curve() const;
-
- void set_fog_height_enabled(bool p_enabled);
- bool is_fog_height_enabled() const;
- void set_fog_height_min(float p_distance);
- float get_fog_height_min() const;
- void set_fog_height_max(float p_distance);
- float get_fog_height_max() const;
- void set_fog_height_curve(float p_distance);
- float get_fog_height_curve() const;
+ void set_fog_light_color(const Color &p_light_color);
+ Color get_fog_light_color() const;
+ void set_fog_light_energy(float p_amount);
+ float get_fog_light_energy() const;
+ void set_fog_sun_scatter(float p_amount);
+ float get_fog_sun_scatter() const;
+
+ void set_fog_density(float p_amount);
+ float get_fog_density() const;
+ void set_fog_height(float p_amount);
+ float get_fog_height() const;
+ void set_fog_height_density(float p_amount);
+ float get_fog_height_density() 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);
@@ -399,5 +411,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