diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-02-07 23:48:09 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-02-08 07:35:14 -0300 |
commit | 07bbcf91f79480441fdaa1779f7244cdad6e1ba9 (patch) | |
tree | 5d0dd8e015c72c37d8291ad3db3d0759ebba474e /scene/3d | |
parent | a73d46caa607a0de354ab3d7489dec64e070e4c5 (diff) |
basic contact shadows implementation, will most likely need some polishing
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/light.cpp | 3 | ||||
-rw-r--r-- | scene/3d/light.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 0c6c113dd2..799c00d266 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -253,6 +253,7 @@ void Light::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow_enabled"), _SCS("set_shadow"), _SCS("has_shadow")); ADD_PROPERTY( PropertyInfo( Variant::COLOR, "shadow_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_shadow_color"), _SCS("get_shadow_color")); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_bias",PROPERTY_HINT_RANGE,"-16,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_contact",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_CONTACT_SHADOW_SIZE); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_max_distance",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_MAX_DISTANCE); ADD_GROUP("Editor",""); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editor_only"), _SCS("set_editor_only"), _SCS("is_editor_only")); @@ -264,6 +265,7 @@ void Light::_bind_methods() { BIND_CONSTANT( PARAM_ATTENUATION ); BIND_CONSTANT( PARAM_SPOT_ANGLE ); BIND_CONSTANT( PARAM_SPOT_ATTENUATION ); + BIND_CONSTANT( PARAM_CONTACT_SHADOW_SIZE ); BIND_CONSTANT( PARAM_SHADOW_MAX_DISTANCE ); BIND_CONSTANT( PARAM_SHADOW_SPLIT_1_OFFSET ); BIND_CONSTANT( PARAM_SHADOW_SPLIT_2_OFFSET ); @@ -297,6 +299,7 @@ Light::Light(VisualServer::LightType p_type) { set_param(PARAM_ATTENUATION,1); set_param(PARAM_SPOT_ANGLE,45); set_param(PARAM_SPOT_ATTENUATION,1); + set_param(PARAM_CONTACT_SHADOW_SIZE,0); set_param(PARAM_SHADOW_MAX_DISTANCE,0); set_param(PARAM_SHADOW_SPLIT_1_OFFSET,0.1); set_param(PARAM_SHADOW_SPLIT_2_OFFSET,0.2); diff --git a/scene/3d/light.h b/scene/3d/light.h index d27b9fed12..4cf0156d5c 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -55,6 +55,7 @@ public: PARAM_ATTENUATION = VS::LIGHT_PARAM_ATTENUATION, PARAM_SPOT_ANGLE = VS::LIGHT_PARAM_SPOT_ANGLE, PARAM_SPOT_ATTENUATION = VS::LIGHT_PARAM_SPOT_ATTENUATION, + PARAM_CONTACT_SHADOW_SIZE= VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE, PARAM_SHADOW_MAX_DISTANCE = VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE, PARAM_SHADOW_SPLIT_1_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, PARAM_SHADOW_SPLIT_2_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, |