diff options
Diffstat (limited to 'servers/rendering/rasterizer.h')
-rw-r--r-- | servers/rendering/rasterizer.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/servers/rendering/rasterizer.h b/servers/rendering/rasterizer.h index b2b2b4977b..4df140f8c3 100644 --- a/servers/rendering/rasterizer.h +++ b/servers/rendering/rasterizer.h @@ -32,8 +32,8 @@ #define RASTERIZER_H #include "core/math/camera_matrix.h" -#include "core/pair.h" -#include "core/self_list.h" +#include "core/templates/pair.h" +#include "core/templates/self_list.h" #include "servers/rendering_server.h" class RasterizerScene { @@ -752,6 +752,9 @@ public: virtual void render_target_disable_clear_request(RID p_render_target) = 0; virtual void render_target_do_clear_request(RID p_render_target) = 0; + virtual void render_target_set_sdf_size_and_scale(RID p_render_target, RS::ViewportSDFOversize p_size, RS::ViewportSDFScale p_scale) = 0; + virtual Rect2i render_target_get_sdf_rect(RID p_render_target) const = 0; + virtual RS::InstanceType get_base_type(RID p_rid) const = 0; virtual bool free(RID p_rid) = 0; @@ -809,7 +812,6 @@ public: static RasterizerCanvas *singleton; enum CanvasRectFlags { - CANVAS_RECT_REGION = 1, CANVAS_RECT_TILE = 2, CANVAS_RECT_FLIP_H = 4, @@ -832,7 +834,9 @@ public: int layer_max; int item_mask; int item_shadow_mask; + float directional_distance; RS::CanvasLightMode mode; + RS::CanvasLightBlendMode blend_mode; RID texture; Vector2 texture_offset; RID canvas; @@ -854,7 +858,7 @@ public: Light *shadows_next_ptr; Light *filter_next_ptr; Light *next_ptr; - Light *mask_next_ptr; + Light *directional_next_ptr; RID light_internal; uint64_t version; @@ -875,16 +879,18 @@ public: scale = 1.0; energy = 1.0; item_shadow_mask = 1; - mode = RS::CANVAS_LIGHT_MODE_ADD; + mode = RS::CANVAS_LIGHT_MODE_POINT; + blend_mode = RS::CANVAS_LIGHT_BLEND_MODE_ADD; // texture_cache = nullptr; next_ptr = nullptr; - mask_next_ptr = nullptr; + directional_next_ptr = nullptr; filter_next_ptr = nullptr; use_shadow = false; shadow_buffer_size = 2048; shadow_filter = RS::CANVAS_LIGHT_FILTER_NONE; shadow_smooth = 0.0; render_index_cache = -1; + directional_distance = 10000.0; } }; @@ -939,7 +945,6 @@ public: struct Command { enum Type { - TYPE_RECT, TYPE_NINEPATCH, TYPE_POLYGON, @@ -1322,7 +1327,7 @@ public: } }; - virtual void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel) = 0; + virtual void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) = 0; virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) = 0; struct LightOccluderInstance { @@ -1334,12 +1339,14 @@ public: Transform2D xform; Transform2D xform_cache; int light_mask; + bool sdf_collision; RS::CanvasOccluderPolygonCullMode cull_cache; LightOccluderInstance *next; LightOccluderInstance() { enabled = true; + sdf_collision = false; next = nullptr; light_mask = 1; cull_cache = RS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; @@ -1350,9 +1357,12 @@ public: virtual void light_set_texture(RID p_rid, RID p_texture) = 0; virtual void light_set_use_shadow(RID p_rid, bool p_enable) = 0; virtual void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) = 0; + virtual void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders) = 0; + + virtual void render_sdf(RID p_render_target, LightOccluderInstance *p_occluders) = 0; virtual RID occluder_polygon_create() = 0; - virtual void occluder_polygon_set_shape_as_lines(RID p_occluder, const Vector<Vector2> &p_lines) = 0; + virtual void occluder_polygon_set_shape(RID p_occluder, const Vector<Vector2> &p_points, bool p_closed) = 0; virtual void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) = 0; virtual void set_shadow_texture_size(int p_size) = 0; |