summaryrefslogtreecommitdiffstats
path: root/scene/resources/sky_box.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-05-28 21:46:48 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-05-28 21:48:05 -0300
commitbb20f230ad307a2a5f18c03bece3793d29ae208a (patch)
treeb217d7c10054e23b0f456acee41bc208dc12bfdf /scene/resources/sky_box.h
parent06fc9637966dafe8e06e1d4f823bf9e8b3475c97 (diff)
downloadredot-engine-bb20f230ad307a2a5f18c03bece3793d29ae208a.tar.gz
-Added .hdr format support
-Added default environment editor setting -Added environment created by default in new projects -Removed default light and ambient from spatial editor, to make the editor more PBR compliant
Diffstat (limited to 'scene/resources/sky_box.h')
-rw-r--r--scene/resources/sky_box.h112
1 files changed, 100 insertions, 12 deletions
diff --git a/scene/resources/sky_box.h b/scene/resources/sky_box.h
index afbfb3019e..7b707af3a6 100644
--- a/scene/resources/sky_box.h
+++ b/scene/resources/sky_box.h
@@ -62,17 +62,6 @@ VARIANT_ENUM_CAST(Sky::RadianceSize)
class PanoramaSky : public Sky {
GDCLASS(PanoramaSky, Sky);
-public:
- enum ImagePath {
- IMAGE_PATH_NEGATIVE_X,
- IMAGE_PATH_POSITIVE_X,
- IMAGE_PATH_NEGATIVE_Y,
- IMAGE_PATH_POSITIVE_Y,
- IMAGE_PATH_NEGATIVE_Z,
- IMAGE_PATH_POSITIVE_Z,
- IMAGE_PATH_MAX
- };
-
private:
RID sky;
Ref<Texture> panorama;
@@ -91,6 +80,105 @@ public:
~PanoramaSky();
};
-VARIANT_ENUM_CAST(PanoramaSky::ImagePath)
+class ProceduralSky : public Sky {
+ GDCLASS(ProceduralSky, Sky);
+
+public:
+ enum TextureSize {
+ TEXTURE_SIZE_1024,
+ TEXTURE_SIZE_2048,
+ TEXTURE_SIZE_4096,
+ TEXTURE_SIZE_MAX
+ };
+
+private:
+ Color sky_top_color;
+ Color sky_horizon_color;
+ float sky_curve;
+ float sky_energy;
+
+ Color ground_bottom_color;
+ Color ground_horizon_color;
+ float ground_curve;
+ float ground_energy;
+
+ Color sun_color;
+ float sun_latitude;
+ float sun_longitude;
+ float sun_angle_min;
+ float sun_angle_max;
+ float sun_curve;
+ float sun_energy;
+
+ TextureSize texture_size;
+
+ RID sky;
+ RID texture;
+
+ bool update_queued;
+
+protected:
+ static void _bind_methods();
+ virtual void _radiance_changed();
+
+ void _update_sky();
+ void _queue_update();
+
+public:
+ void set_sky_top_color(const Color &p_sky_top);
+ Color get_sky_top_color() const;
+
+ void set_sky_horizon_color(const Color &p_sky_horizon);
+ Color get_sky_horizon_color() const;
+
+ void set_sky_curve(float p_curve);
+ float get_sky_curve() const;
+
+ void set_sky_energy(float p_energy);
+ float get_sky_energy() const;
+
+ void set_ground_bottom_color(const Color &p_ground_bottom);
+ Color get_ground_bottom_color() const;
+
+ void set_ground_horizon_color(const Color &p_ground_horizon);
+ Color get_ground_horizon_color() const;
+
+ void set_ground_curve(float p_curve);
+ float get_ground_curve() const;
+
+ void set_ground_energy(float p_energy);
+ float get_ground_energy() const;
+
+ void set_sun_color(const Color &p_sun);
+ Color get_sun_color() const;
+
+ void set_sun_latitude(float p_angle);
+ float get_sun_latitude() const;
+
+ void set_sun_longitude(float p_angle);
+ float get_sun_longitude() const;
+
+ void set_sun_angle_min(float p_angle);
+ float get_sun_angle_min() const;
+
+ void set_sun_angle_max(float p_angle);
+ float get_sun_angle_max() const;
+
+ void set_sun_curve(float p_curve);
+ float get_sun_curve() const;
+
+ void set_sun_energy(float p_energy);
+ float get_sun_energy() const;
+
+ void set_texture_size(TextureSize p_size);
+ TextureSize get_texture_size() const;
+
+ virtual RID get_rid() const;
+
+ ProceduralSky();
+ ~ProceduralSky();
+};
+
+VARIANT_ENUM_CAST(ProceduralSky::TextureSize)
#endif // Sky_H