diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-13 01:23:04 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-13 01:23:04 -0300 |
commit | a8a1f2e2a864e6b58d5bcf1c7e53a43cdb6d95d9 (patch) | |
tree | 39a7c01d77ca73931ad48f14c28eb643d78864bb /servers | |
parent | 95c248e24fb6094160f9c71140402305b57469ab (diff) |
-Fixed occluder rendering, closes #8560
-Ability to smooth out 2D shadow filters
Diffstat (limited to 'servers')
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.cpp | 7 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.h | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 1 | ||||
-rw-r--r-- | servers/visual_server.h | 1 |
6 files changed, 13 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index eb06c64c40..c5fc2fe8af 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -546,6 +546,7 @@ public: float shadow_gradient_length; VS::CanvasLightShadowFilter shadow_filter; Color shadow_color; + float shadow_smooth; void *texture_cache; // implementation dependent Rect2 rect_cache; @@ -584,6 +585,7 @@ public: shadow_buffer_size = 256; shadow_gradient_length = 0; shadow_filter = VS::CANVAS_LIGHT_FILTER_NONE; + shadow_smooth = 0.0; } }; diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index 14a7af3e6e..48e6a3d006 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -916,6 +916,13 @@ void VisualServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color clight->shadow_color = p_color; } +void VisualServerCanvas::canvas_light_set_shadow_smooth(RID p_light, float p_smooth) { + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + clight->shadow_smooth = p_smooth; +} + RID VisualServerCanvas::canvas_light_occluder_create() { RasterizerCanvas::LightOccluderInstance *occluder = memnew(RasterizerCanvas::LightOccluderInstance); diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h index 47b057f96a..b4ddf2dc8e 100644 --- a/servers/visual/visual_server_canvas.h +++ b/servers/visual/visual_server_canvas.h @@ -209,6 +209,7 @@ public: void canvas_light_set_shadow_gradient_length(RID p_light, float p_length); void canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter); void canvas_light_set_shadow_color(RID p_light, const Color &p_color); + void canvas_light_set_shadow_smooth(RID p_light, float p_smooth); RID canvas_light_occluder_create(); void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index b4b43a31be..dc44755726 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -1082,6 +1082,7 @@ public: BIND2(canvas_light_set_shadow_gradient_length, RID, float) BIND2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter) BIND2(canvas_light_set_shadow_color, RID, const Color &) + BIND2(canvas_light_set_shadow_smooth, RID, float) BIND0R(RID, canvas_light_occluder_create) BIND2(canvas_light_occluder_attach_to_canvas, RID, RID) diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 6d65999df1..05d8fb3dcd 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -511,6 +511,7 @@ public: FUNC2(canvas_light_set_shadow_gradient_length, RID, float) FUNC2(canvas_light_set_shadow_filter, RID, CanvasLightShadowFilter) FUNC2(canvas_light_set_shadow_color, RID, const Color &) + FUNC2(canvas_light_set_shadow_smooth, RID, float) FUNC0R(RID, canvas_light_occluder_create) FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID) diff --git a/servers/visual_server.h b/servers/visual_server.h index 3290a460a1..4f2f9d30fa 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -844,6 +844,7 @@ public: virtual void canvas_light_set_shadow_gradient_length(RID p_light, float p_length) = 0; virtual void canvas_light_set_shadow_filter(RID p_light, CanvasLightShadowFilter p_filter) = 0; virtual void canvas_light_set_shadow_color(RID p_light, const Color &p_color) = 0; + virtual void canvas_light_set_shadow_smooth(RID p_light, float p_smooth) = 0; virtual RID canvas_light_occluder_create() = 0; virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas) = 0; |