summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-04-01 23:24:52 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-04-02 11:25:21 -0300
commit87c658b3041b86557d0131ffb3e187a60c3e9af0 (patch)
treee124f61b12422bc1001f6b556b8f717c2d780a1a /scene
parentff14d071ccfdf25b899ab49312ef639da7c71fd6 (diff)
Re-Added screen space reflection.
Diffstat (limited to 'scene')
-rw-r--r--scene/register_scene_types.cpp3
-rw-r--r--scene/resources/environment.cpp27
-rw-r--r--scene/resources/environment.h4
3 files changed, 9 insertions, 25 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 22c000fae7..e11abb5fba 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -850,6 +850,9 @@ void register_scene_types() {
ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp");
ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatUniform");
ClassDB::add_compatibility_class("World", "World3D");
+ ClassDB::add_compatibility_class("ProceduralSky", "Sky");
+ ClassDB::add_compatibility_class("PanoramaSky", "Sky");
+
#endif
OS::get_singleton()->yield(); //may take time to init
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 6fa52e6f05..832b9fcee8 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -389,7 +389,7 @@ void Environment::_validate_property(PropertyInfo &property) const {
void Environment::set_ssr_enabled(bool p_enable) {
ssr_enabled = p_enable;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance);
_change_notify();
}
@@ -401,7 +401,7 @@ bool Environment::is_ssr_enabled() const {
void Environment::set_ssr_max_steps(int p_steps) {
ssr_max_steps = p_steps;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance);
}
int Environment::get_ssr_max_steps() const {
@@ -411,7 +411,7 @@ int Environment::get_ssr_max_steps() const {
void Environment::set_ssr_fade_in(float p_fade_in) {
ssr_fade_in = p_fade_in;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance);
}
float Environment::get_ssr_fade_in() const {
@@ -421,7 +421,7 @@ float Environment::get_ssr_fade_in() const {
void Environment::set_ssr_fade_out(float p_fade_out) {
ssr_fade_out = p_fade_out;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance);
}
float Environment::get_ssr_fade_out() const {
@@ -431,23 +431,13 @@ float Environment::get_ssr_fade_out() const {
void Environment::set_ssr_depth_tolerance(float p_depth_tolerance) {
ssr_depth_tolerance = p_depth_tolerance;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
+ RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance);
}
float Environment::get_ssr_depth_tolerance() const {
return ssr_depth_tolerance;
}
-void Environment::set_ssr_rough(bool p_enable) {
-
- ssr_roughness = p_enable;
- RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance, ssr_roughness);
-}
-bool Environment::is_ssr_rough() const {
-
- return ssr_roughness;
-}
-
void Environment::set_ssao_enabled(bool p_enable) {
ssao_enabled = p_enable;
@@ -981,16 +971,12 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_ssr_depth_tolerance", "depth_tolerance"), &Environment::set_ssr_depth_tolerance);
ClassDB::bind_method(D_METHOD("get_ssr_depth_tolerance"), &Environment::get_ssr_depth_tolerance);
- ClassDB::bind_method(D_METHOD("set_ssr_rough", "rough"), &Environment::set_ssr_rough);
- ClassDB::bind_method(D_METHOD("is_ssr_rough"), &Environment::is_ssr_rough);
-
ADD_GROUP("SS Reflections", "ss_reflections_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ss_reflections_enabled"), "set_ssr_enabled", "is_ssr_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "ss_reflections_max_steps", PROPERTY_HINT_RANGE, "1,512,1"), "set_ssr_max_steps", "get_ssr_max_steps");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_fade_in", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_in", "get_ssr_fade_in");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_fade_out", PROPERTY_HINT_EXP_EASING), "set_ssr_fade_out", "get_ssr_fade_out");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_depth_tolerance", PROPERTY_HINT_RANGE, "0.1,128,0.1"), "set_ssr_depth_tolerance", "get_ssr_depth_tolerance");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ss_reflections_roughness"), "set_ssr_rough", "is_ssr_rough");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ss_reflections_depth_tolerance", PROPERTY_HINT_RANGE, "0.01,128,0.1"), "set_ssr_depth_tolerance", "get_ssr_depth_tolerance");
ClassDB::bind_method(D_METHOD("set_ssao_enabled", "enabled"), &Environment::set_ssao_enabled);
ClassDB::bind_method(D_METHOD("is_ssao_enabled"), &Environment::is_ssao_enabled);
@@ -1173,7 +1159,6 @@ Environment::Environment() :
ssr_fade_in = 0.15;
ssr_fade_out = 2.0;
ssr_depth_tolerance = 0.2;
- ssr_roughness = true;
ssao_enabled = false;
ssao_radius = 1;
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index 83f9a3f509..02434bc592 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -125,7 +125,6 @@ private:
float ssr_fade_in;
float ssr_fade_out;
float ssr_depth_tolerance;
- bool ssr_roughness;
bool ssao_enabled;
float ssao_radius;
@@ -257,9 +256,6 @@ public:
void set_ssr_depth_tolerance(float p_depth_tolerance);
float get_ssr_depth_tolerance() const;
- void set_ssr_rough(bool p_enable);
- bool is_ssr_rough() const;
-
void set_ssao_enabled(bool p_enable);
bool is_ssao_enabled() const;