summaryrefslogtreecommitdiff
path: root/scene/resources/environment.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-01-13 15:37:24 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 12:15:03 +0100
commitf14defb6f9713a4adf1b7565d2bcbe13393f3f81 (patch)
treec7cb38a1d9857e543fef12db34edf4ed589b04cb /scene/resources/environment.h
parentbd364d1447ea3b745299c6460d6d90acd8637ab5 (diff)
WIP CameraEffects implementation (bokeh not working for now)
Diffstat (limited to 'scene/resources/environment.h')
-rw-r--r--scene/resources/environment.h119
1 files changed, 70 insertions, 49 deletions
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index 7926d5d284..530fa727b1 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -80,12 +80,6 @@ public:
GLOW_BLEND_MODE_MIX,
};
- enum DOFBlurQuality {
- DOF_BLUR_QUALITY_LOW,
- DOF_BLUR_QUALITY_MEDIUM,
- DOF_BLUR_QUALITY_HIGH,
- };
-
enum SSAOBlur {
SSAO_BLUR_DISABLED,
SSAO_BLUR_1x1,
@@ -163,18 +157,6 @@ private:
float glow_hdr_luminance_cap;
bool glow_bicubic_upscale;
- bool dof_blur_far_enabled;
- float dof_blur_far_distance;
- float dof_blur_far_transition;
- float dof_blur_far_amount;
- DOFBlurQuality dof_blur_far_quality;
-
- bool dof_blur_near_enabled;
- float dof_blur_near_distance;
- float dof_blur_near_transition;
- float dof_blur_near_amount;
- DOFBlurQuality dof_blur_near_quality;
-
bool fog_enabled;
Color fog_color;
Color fog_sun_color;
@@ -356,36 +338,6 @@ public:
void set_glow_bicubic_upscale(bool p_enable);
bool is_glow_bicubic_upscale_enabled() const;
- void set_dof_blur_far_enabled(bool p_enable);
- bool is_dof_blur_far_enabled() const;
-
- void set_dof_blur_far_distance(float p_distance);
- float get_dof_blur_far_distance() const;
-
- void set_dof_blur_far_transition(float p_distance);
- float get_dof_blur_far_transition() const;
-
- void set_dof_blur_far_amount(float p_amount);
- float get_dof_blur_far_amount() const;
-
- void set_dof_blur_far_quality(DOFBlurQuality p_quality);
- DOFBlurQuality get_dof_blur_far_quality() const;
-
- void set_dof_blur_near_enabled(bool p_enable);
- bool is_dof_blur_near_enabled() const;
-
- void set_dof_blur_near_distance(float p_distance);
- float get_dof_blur_near_distance() const;
-
- void set_dof_blur_near_transition(float p_distance);
- float get_dof_blur_near_transition() const;
-
- void set_dof_blur_near_amount(float p_amount);
- float get_dof_blur_near_amount() const;
-
- void set_dof_blur_near_quality(DOFBlurQuality p_quality);
- DOFBlurQuality get_dof_blur_near_quality() const;
-
void set_fog_enabled(bool p_enabled);
bool is_fog_enabled() const;
@@ -439,8 +391,77 @@ VARIANT_ENUM_CAST(Environment::AmbientSource)
VARIANT_ENUM_CAST(Environment::ReflectionSource)
VARIANT_ENUM_CAST(Environment::ToneMapper)
VARIANT_ENUM_CAST(Environment::GlowBlendMode)
-VARIANT_ENUM_CAST(Environment::DOFBlurQuality)
VARIANT_ENUM_CAST(Environment::SSAOQuality)
VARIANT_ENUM_CAST(Environment::SSAOBlur)
+class CameraEffects : public Resource {
+
+ GDCLASS(CameraEffects, Resource);
+
+public:
+ enum DOFBlurQuality {
+ DOF_BLUR_QUALITY_LOW,
+ DOF_BLUR_QUALITY_MEDIUM,
+ DOF_BLUR_QUALITY_HIGH,
+ };
+
+private:
+ RID camera_effects;
+
+ bool dof_blur_far_enabled;
+ float dof_blur_far_distance;
+ float dof_blur_far_transition;
+
+ bool dof_blur_near_enabled;
+ float dof_blur_near_distance;
+ float dof_blur_near_transition;
+
+ float dof_blur_amount;
+ DOFBlurQuality dof_blur_quality;
+
+ bool override_exposure_enabled;
+ float override_exposure;
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_dof_blur_far_enabled(bool p_enable);
+ bool is_dof_blur_far_enabled() const;
+
+ void set_dof_blur_far_distance(float p_distance);
+ float get_dof_blur_far_distance() const;
+
+ void set_dof_blur_far_transition(float p_distance);
+ float get_dof_blur_far_transition() const;
+
+ void set_dof_blur_near_enabled(bool p_enable);
+ bool is_dof_blur_near_enabled() const;
+
+ void set_dof_blur_near_distance(float p_distance);
+ float get_dof_blur_near_distance() const;
+
+ void set_dof_blur_near_transition(float p_distance);
+ float get_dof_blur_near_transition() const;
+
+ void set_dof_blur_amount(float p_amount);
+ float get_dof_blur_amount() const;
+
+ void set_dof_blur_quality(DOFBlurQuality p_quality);
+ DOFBlurQuality get_dof_blur_quality() const;
+
+ void set_override_exposure_enabled(bool p_enabled);
+ bool is_override_exposure_enabled() const;
+
+ void set_override_exposure(float p_exposure);
+ float get_override_exposure() const;
+
+ virtual RID get_rid() const;
+
+ CameraEffects();
+ ~CameraEffects();
+};
+
+VARIANT_ENUM_CAST(CameraEffects::DOFBlurQuality)
+
#endif // ENVIRONMENT_H