summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-15 10:22:09 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-15 10:22:09 +0100
commitaec4f57f9507208f9aef499d8a8e8d1642bf2c72 (patch)
treefc326c281798915e9f6f38ab96d3b2ee30b69672 /scene
parentc1a1adae280c6a25fa776dfd083b6d7a48f580c0 (diff)
parentde5281c3989fd4071cf57e5b7bc0cbbc174524e8 (diff)
Merge pull request #3528 from SaracenOne/baked_light_realtime_colourize
Ability to colourize baked lighting in real time.
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/baked_light.cpp46
-rw-r--r--scene/resources/baked_light.h9
2 files changed, 55 insertions, 0 deletions
diff --git a/scene/resources/baked_light.cpp b/scene/resources/baked_light.cpp
index 31282a0274..aa4aae03cb 100644
--- a/scene/resources/baked_light.cpp
+++ b/scene/resources/baked_light.cpp
@@ -256,6 +256,38 @@ float BakedLight::get_ao_strength() const {
return ao_strength;
}
+void BakedLight::set_realtime_color_enabled(const bool p_realtime_color_enabled) {
+
+ VS::get_singleton()->baked_light_set_realtime_color_enabled(baked_light, p_realtime_color_enabled);
+}
+
+bool BakedLight::get_realtime_color_enabled() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_color_enabled(baked_light);
+}
+
+
+void BakedLight::set_realtime_color(const Color &p_realtime_color) {
+
+ VS::get_singleton()->baked_light_set_realtime_color(baked_light, p_realtime_color);
+}
+
+Color BakedLight::get_realtime_color() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_color(baked_light);
+}
+
+void BakedLight::set_realtime_energy(const float p_realtime_energy) {
+
+ VS::get_singleton()->baked_light_set_realtime_energy(baked_light, p_realtime_energy);
+}
+
+float BakedLight::get_realtime_energy() const {
+
+ return VS::get_singleton()->baked_light_get_realtime_energy(baked_light);
+}
+
+
void BakedLight::set_energy_multiplier(float p_multiplier){
@@ -434,6 +466,15 @@ void BakedLight::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_ao_strength","ao_strength"),&BakedLight::set_ao_strength);
ObjectTypeDB::bind_method(_MD("get_ao_strength"),&BakedLight::get_ao_strength);
+ ObjectTypeDB::bind_method(_MD("set_realtime_color_enabled", "enabled"), &BakedLight::set_realtime_color_enabled);
+ ObjectTypeDB::bind_method(_MD("get_realtime_color_enabled"), &BakedLight::get_realtime_color_enabled);
+
+ ObjectTypeDB::bind_method(_MD("set_realtime_color", "tint"), &BakedLight::set_realtime_color);
+ ObjectTypeDB::bind_method(_MD("get_realtime_color"), &BakedLight::get_realtime_color);
+
+ ObjectTypeDB::bind_method(_MD("set_realtime_energy", "energy"), &BakedLight::set_realtime_energy);
+ ObjectTypeDB::bind_method(_MD("get_realtime_energy"), &BakedLight::get_realtime_energy);
+
ObjectTypeDB::bind_method(_MD("set_format","format"),&BakedLight::set_format);
ObjectTypeDB::bind_method(_MD("get_format"),&BakedLight::get_format);
@@ -480,6 +521,11 @@ void BakedLight::_bind_methods(){
ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_radius",PROPERTY_HINT_RANGE,"0.0,16.0,0.01"),_SCS("set_ao_radius"),_SCS("get_ao_radius"));
ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_strength",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_ao_strength"),_SCS("get_ao_strength"));
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "realtime/enabled"), _SCS("set_realtime_color_enabled"), _SCS("get_realtime_color_enabled"));
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "realtime/color", PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_realtime_color"), _SCS("get_realtime_color"));
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "realtime/energy", PROPERTY_HINT_RANGE, "0.01,4096.0,0.01"), _SCS("set_realtime_energy"), _SCS("get_realtime_energy"));
+
+
BIND_CONSTANT( MODE_OCTREE );
BIND_CONSTANT( MODE_LIGHTMAPS );
diff --git a/scene/resources/baked_light.h b/scene/resources/baked_light.h
index 41e1e5f9e0..f9a1368e8d 100644
--- a/scene/resources/baked_light.h
+++ b/scene/resources/baked_light.h
@@ -116,6 +116,15 @@ public:
void set_ao_strength(float p_ao_strength);
float get_ao_strength() const;
+ void set_realtime_color_enabled(const bool p_enabled);
+ bool get_realtime_color_enabled() const;
+
+ void set_realtime_color(const Color& p_realtime_color);
+ Color get_realtime_color() const;
+
+ void set_realtime_energy(const float p_realtime_energy);
+ float get_realtime_energy() const;
+
void set_bake_flag(BakeFlags p_flags,bool p_enable);
bool get_bake_flag(BakeFlags p_flags) const;