diff options
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.cpp | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer.h | 24 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.cpp | 32 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.h | 10 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 160 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 19 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 12 |
8 files changed, 235 insertions, 26 deletions
diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp index c3dcd83a31..5088000022 100644 --- a/servers/visual/rasterizer.cpp +++ b/servers/visual/rasterizer.cpp @@ -91,7 +91,7 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) { scode+="uniform float fmp_normal;\n"; scode+="uniform texture fmp_normal_tex;\n"; String uv_str; - if ((p_key.texcoord_mask>>(VS::FIXED_MATERIAL_PARAM_NORMAL*2))&0x3==VS::FIXED_MATERIAL_TEXCOORD_SPHERE) { + if (((p_key.texcoord_mask>>(VS::FIXED_MATERIAL_PARAM_NORMAL*2))&0x3)==VS::FIXED_MATERIAL_TEXCOORD_SPHERE) { uv_str="uv"; //sorry not supported } else { uv_str=_TEXUVSTR(VS::FIXED_MATERIAL_PARAM_NORMAL); diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index d2a1c48c46..62563a0771 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -577,13 +577,15 @@ public: Color color; Matrix32 xform; float height; + float energy; + float scale; int z_min; int z_max; int layer_min; int layer_max; int item_mask; int item_shadow_mask; - bool subtract; + VS::CanvasLightMode mode; RID texture; Vector2 texture_offset; RID canvas; @@ -614,8 +616,10 @@ public: layer_min=0; layer_max=0; item_mask=1; + scale=1.0; + energy=1.0; item_shadow_mask=-1; - subtract=false; + mode=VS::CANVAS_LIGHT_MODE_ADD; texture_cache=NULL; next_ptr=NULL; filter_next_ptr=NULL; @@ -633,9 +637,9 @@ public: Map<StringName,Variant> shader_param; uint32_t shader_version; Set<CanvasItem*> owners; - bool unshaded; + VS::CanvasItemShadingMode shading_mode; - CanvasItemMaterial() {unshaded=false; shader_version=0; } + CanvasItemMaterial() {shading_mode=VS::CANVAS_ITEM_SHADING_NORMAL; shader_version=0; } }; struct CanvasItem { @@ -767,6 +771,12 @@ public: mutable Rect2 rect; CanvasItem*next; CanvasItemMaterial* material; + struct CopyBackBuffer { + Rect2 rect; + Rect2 screen_rect; + bool full; + }; + CopyBackBuffer *copy_back_buffer; float final_opacity; @@ -775,6 +785,7 @@ public: CanvasItem* final_clip_owner; CanvasItem* material_owner; ViewportRender *vp_render; + bool distance_field; Rect2 global_rect_cache; @@ -902,14 +913,15 @@ public: } void clear() { for (int i=0;i<commands.size();i++) memdelete( commands[i] ); commands.clear(); clip=false; rect_dirty=true; final_clip_owner=NULL; material_owner=NULL;} - CanvasItem() { light_mask=1; vp_render=NULL; next=NULL; final_clip_owner=NULL; clip=false; final_opacity=1; blend_mode=VS::MATERIAL_BLEND_MODE_MIX; visible=true; rect_dirty=true; custom_rect=false; ontop=true; material_owner=NULL; material=NULL; } - virtual ~CanvasItem() { clear(); } + CanvasItem() { light_mask=1; vp_render=NULL; next=NULL; final_clip_owner=NULL; clip=false; final_opacity=1; blend_mode=VS::MATERIAL_BLEND_MODE_MIX; visible=true; rect_dirty=true; custom_rect=false; ontop=true; material_owner=NULL; material=NULL; copy_back_buffer=NULL; distance_field=false; } + virtual ~CanvasItem() { clear(); if (copy_back_buffer) memdelete(copy_back_buffer); } }; CanvasItemDrawViewportFunc draw_viewport_func; + virtual void begin_canvas_bg()=0; virtual void canvas_begin()=0; virtual void canvas_disable_blending()=0; virtual void canvas_set_opacity(float p_opacity)=0; diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp index 7fb8eb02fc..45b29f5484 100644 --- a/servers/visual/rasterizer_dummy.cpp +++ b/servers/visual/rasterizer_dummy.cpp @@ -1545,9 +1545,36 @@ void RasterizerDummy::end_frame() { } +RID RasterizerDummy::canvas_light_occluder_create() { + return RID(); +} + +void RasterizerDummy::canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines) { + + +} + +RID RasterizerDummy::canvas_light_shadow_buffer_create(int p_width) { + + return RID(); +} + +void RasterizerDummy::canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache) { + + +} + +void RasterizerDummy::canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow) { + + +} + /* CANVAS API */ +void RasterizerDummy::begin_canvas_bg() { + +} void RasterizerDummy::canvas_begin() { @@ -1761,6 +1788,11 @@ bool RasterizerDummy::is_environment(const RID& p_rid) const { return environment_owner.owns(p_rid); } +bool RasterizerDummy::is_canvas_light_occluder(const RID& p_rid) const { + + return false; +} + bool RasterizerDummy::is_shader(const RID& p_rid) const { return false; diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index baa48951d6..99c76a1917 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -696,6 +696,7 @@ public: /* CANVAS API */ + virtual void begin_canvas_bg(); virtual void canvas_begin(); virtual void canvas_disable_blending(); virtual void canvas_set_opacity(float p_opacity); @@ -712,6 +713,14 @@ public: virtual void canvas_render_items(CanvasItem *p_item_list,int p_z,const Color& p_modulate,CanvasLight *p_light); + virtual RID canvas_light_occluder_create(); + virtual void canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines); + + virtual RID canvas_light_shadow_buffer_create(int p_width); + virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache); + + virtual void canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow); + /* ENVIRONMENT */ virtual RID environment_create(); @@ -747,6 +756,7 @@ public: virtual bool is_particles_instance(const RID& p_rid) const; virtual bool is_skeleton(const RID& p_rid) const; virtual bool is_environment(const RID& p_rid) const; + virtual bool is_canvas_light_occluder(const RID& p_rid) const; virtual bool is_shader(const RID& p_rid) const; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index af65a7a639..4ad8aa6c71 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1171,7 +1171,9 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_light_builtins_defs[]={ { "LIGHT_VEC", TYPE_VEC2}, { "LIGHT_HEIGHT", TYPE_FLOAT}, { "LIGHT_COLOR", TYPE_VEC4}, + { "LIGHT_UV", TYPE_VEC2}, { "LIGHT", TYPE_VEC4}, + { "SHADOW", TYPE_VEC4}, { "POINT_COORD", TYPE_VEC2}, // { "SCREEN_POS", TYPE_VEC2}, // { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 1c16f51e89..7a9db4ba11 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -1693,6 +1693,17 @@ void VisualServerRaster::viewport_set_hide_canvas(RID p_viewport,bool p_hide) { } +void VisualServerRaster::viewport_set_disable_environment(RID p_viewport,bool p_disable) { + + VS_CHANGED; + + Viewport *viewport=NULL; + viewport = viewport_owner.get( p_viewport ); + ERR_FAIL_COND(!viewport); + viewport->disable_environment=p_disable; + +} + void VisualServerRaster::viewport_attach_camera(RID p_viewport,RID p_camera) { VS_CHANGED; @@ -3400,6 +3411,14 @@ void VisualServerRaster::canvas_item_set_clip(RID p_item, bool p_clip) { canvas_item->clip=p_clip; } +void VisualServerRaster::canvas_item_set_distance_field_mode(RID p_item, bool p_distance_field) { + VS_CHANGED; + CanvasItem *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->distance_field=p_distance_field; +} + void VisualServerRaster::canvas_item_set_transform(RID p_item, const Matrix32& p_transform) { @@ -3765,6 +3784,27 @@ void VisualServerRaster::canvas_item_set_z_as_relative_to_parent(RID p_item, boo } +void VisualServerRaster::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable, const Rect2& p_rect) { + + VS_CHANGED; + CanvasItem *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + if (bool(canvas_item->copy_back_buffer!=NULL) !=p_enable) { + if (p_enable) { + canvas_item->copy_back_buffer = memnew( Rasterizer::CanvasItem::CopyBackBuffer ); + } else { + memdelete(canvas_item->copy_back_buffer); + canvas_item->copy_back_buffer=NULL; + } + } + + if (p_enable) { + canvas_item->copy_back_buffer->rect=p_rect; + canvas_item->copy_back_buffer->full=p_rect==Rect2(); + } + +} + void VisualServerRaster::canvas_item_set_use_parent_material(RID p_item, bool p_enable) { VS_CHANGED; @@ -3899,6 +3939,15 @@ void VisualServerRaster::canvas_light_set_transform(RID p_light, const Matrix32& clight->xform=p_transform; } +void VisualServerRaster::canvas_light_set_scale(RID p_light, float p_scale) { + + Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + clight->scale=p_scale; + +} + + void VisualServerRaster::canvas_light_set_texture(RID p_light, RID p_texture){ Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); @@ -3928,6 +3977,15 @@ void VisualServerRaster::canvas_light_set_height(RID p_light, float p_height){ clight->height=p_height; } + +void VisualServerRaster::canvas_light_set_energy(RID p_light, float p_energy){ + + Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + clight->energy=p_energy; + +} + void VisualServerRaster::canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z){ Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); @@ -3963,12 +4021,12 @@ void VisualServerRaster::canvas_light_set_item_shadow_mask(RID p_light, int p_ma } -void VisualServerRaster::canvas_light_set_subtract_mode(RID p_light, bool p_enable) { +void VisualServerRaster::canvas_light_set_mode(RID p_light, CanvasLightMode p_mode) { Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); ERR_FAIL_COND(!clight); - clight->subtract=p_enable; + clight->mode=p_mode; } void VisualServerRaster::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled){ @@ -4218,12 +4276,12 @@ Variant VisualServerRaster::canvas_item_material_get_shader_param(RID p_material return material->shader_param[p_param]; } -void VisualServerRaster::canvas_item_material_set_unshaded(RID p_material, bool p_unshaded){ +void VisualServerRaster::canvas_item_material_set_shading_mode(RID p_material, CanvasItemShadingMode p_mode) { VS_CHANGED; Rasterizer::CanvasItemMaterial *material = canvas_item_material_owner.get( p_material ); ERR_FAIL_COND(!material); - material->unshaded=p_unshaded; + material->shading_mode=p_mode; } @@ -6237,6 +6295,20 @@ void VisualServerRaster::_process_sampled_light(const Transform& p_camera,Instan } +void VisualServerRaster::_render_no_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario) { + RID environment; + if (p_scenario->environment.is_valid()) + environment=p_scenario->environment; + else + environment=p_scenario->fallback_environment; + + rasterizer->set_camera(Transform(),CameraMatrix()); + rasterizer->begin_scene(p_viewport->viewport_data,environment,p_scenario->debug); + rasterizer->set_viewport(viewport_rect); + rasterizer->end_scene(); +} + + void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario) { @@ -6757,8 +6829,12 @@ void VisualServerRaster::_render_canvas_item(CanvasItem *p_canvas_item,const Mat _render_canvas_item(child_items[i],xform,p_clip_rect,opacity,p_z,z_list,z_last_list,(CanvasItem*)ci->final_clip_owner,p_material_owner); } + if (ci->copy_back_buffer) { - if ((!ci->commands.empty() && p_clip_rect.intersects(global_rect)) || ci->vp_render) { + ci->copy_back_buffer->screen_rect = xform.xform(ci->copy_back_buffer->rect).clip(p_clip_rect); + } + + if ((!ci->commands.empty() && p_clip_rect.intersects(global_rect)) || ci->vp_render || ci->copy_back_buffer) { //something to draw? ci->final_transform=xform; ci->final_opacity=opacity * ci->self_opacity; @@ -6855,6 +6931,23 @@ void VisualServerRaster::_render_canvas(Canvas *p_canvas,const Matrix32 &p_trans } +void VisualServerRaster::_draw_viewport_camera(Viewport *p_viewport,bool p_ignore_camera) { + + + Camera *camera=NULL; + if (camera_owner.owns( p_viewport->camera )) + camera=camera_owner.get( p_viewport->camera ); + Scenario *scenario = scenario_owner.get( p_viewport->scenario ); + + _update_instances(); // check dirty instances before rendering + + if (p_ignore_camera) + _render_no_camera(p_viewport, camera,scenario ); + else + _render_camera(p_viewport, camera,scenario ); + +} + void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ofs_y,int p_parent_w,int p_parent_h) { ViewportRect desired_rect=p_viewport->rect; @@ -6889,14 +6982,31 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ /* Camera should always be BEFORE any other 3D */ - if (!p_viewport->hide_scenario && camera_owner.owns(p_viewport->camera) && scenario_owner.owns(p_viewport->scenario)) { + bool scenario_draw_canvas_bg=false; + int scenario_canvas_max_layer=0; + + if (!p_viewport->hide_canvas && !p_viewport->disable_environment && scenario_owner.owns(p_viewport->scenario)) { + + Scenario *scenario=scenario_owner.get(p_viewport->scenario); + if (scenario->environment.is_valid()) { + if (rasterizer->is_environment(scenario->environment)) { + scenario_draw_canvas_bg=rasterizer->environment_get_background(scenario->environment)==VS::ENV_BG_CANVAS; + scenario_canvas_max_layer=rasterizer->environment_get_background_param(scenario->environment,VS::ENV_BG_PARAM_CANVAS_MAX_LAYER); + } + } + } - Camera *camera = camera_owner.get( p_viewport->camera ); - Scenario *scenario = scenario_owner.get( p_viewport->scenario ); + bool can_draw_3d=!p_viewport->hide_scenario && camera_owner.owns(p_viewport->camera) && scenario_owner.owns(p_viewport->scenario); - _update_instances(); // check dirty instances before rendering - _render_camera(p_viewport, camera,scenario ); + if (scenario_draw_canvas_bg) { + + rasterizer->begin_canvas_bg(); + } + + if (!scenario_draw_canvas_bg && can_draw_3d) { + + _draw_viewport_camera(p_viewport,false); } else if (true /*|| !p_viewport->canvas_list.empty()*/){ @@ -6906,7 +7016,10 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ rasterizer->clear_viewport(Color(0,0,0,0)); } else { - rasterizer->clear_viewport(clear_color); + Color cc=clear_color; + if (scenario_draw_canvas_bg) + cc.a=0; + rasterizer->clear_viewport(cc); } p_viewport->render_target_clear=false; } @@ -6937,6 +7050,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ if (cl->enabled && cl->texture.is_valid()) { //not super efficient.. Size2 tsize(rasterizer->texture_get_width(cl->texture),rasterizer->texture_get_height(cl->texture)); + tsize*=cl->scale; Vector2 offset=tsize/2.0; cl->rect_cache=Rect2(-offset+cl->texture_offset,tsize); cl->xform_cache=xf * cl->xform; @@ -7005,6 +7119,16 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ rasterizer->set_viewport(viewport_rect); //must reset viewport afterwards } + + + + if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().layer>scenario_canvas_max_layer) { + + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + + } + for (Map<Viewport::CanvasKey,Viewport::CanvasData*>::Element *E=canvas_map.front();E;E=E->next()) { @@ -7026,9 +7150,21 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ _render_canvas( E->get()->canvas,xform,canvas_lights ); i++; + if (scenario_draw_canvas_bg && E->key().layer>=scenario_canvas_max_layer) { + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + } + + } - //rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); + if (scenario_draw_canvas_bg) { + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + } + + +// rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); } //capture diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 7d7bbe1d71..a89a685e30 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -489,6 +489,8 @@ class VisualServerRaster : public VisualServer { bool render_target_vflip; bool render_target_clear_on_new_frame; bool render_target_clear; + bool disable_environment; + Image capture; bool rendered_in_prev_frame; @@ -515,7 +517,7 @@ class VisualServerRaster : public VisualServer { SelfList<Viewport> update_list; - Viewport() : update_list(this) { transparent_bg=false; render_target_update_mode=RENDER_TARGET_UPDATE_WHEN_VISIBLE; queue_capture=false; rendered_in_prev_frame=false; render_target_vflip=false; render_target_clear_on_new_frame=true; render_target_clear=true;} + Viewport() : update_list(this) { transparent_bg=false; render_target_update_mode=RENDER_TARGET_UPDATE_WHEN_VISIBLE; queue_capture=false; rendered_in_prev_frame=false; render_target_vflip=false; render_target_clear_on_new_frame=true; render_target_clear=true; disable_environment=false; } }; SelfList<Viewport>::List viewport_update_list; @@ -626,6 +628,7 @@ class VisualServerRaster : public VisualServer { void _cull_room(Camera *p_camera, Instance *p_room,Instance *p_from_portal=NULL); void _process_sampled_light(const Transform &p_camera, Instance *p_sampled_light, bool p_linear_colorspace); + void _render_no_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); void _render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); static void _render_canvas_item_viewport(VisualServer* p_self,void *p_vp,const Rect2& p_rect); void _render_canvas_item_tree(CanvasItem *p_canvas_item, const Matrix32& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, Rasterizer::CanvasLight *p_lights); @@ -643,6 +646,7 @@ class VisualServerRaster : public VisualServer { int changes; bool draw_extra_frame; + void _draw_viewport_camera(Viewport *p_viewport, bool p_ignore_camera); void _draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ofs_y,int p_parent_w,int p_parent_h); void _draw_viewports(); void _draw_cursors_and_margins(); @@ -983,6 +987,7 @@ public: virtual void viewport_render_target_clear(RID p_viewport); virtual void viewport_set_render_target_to_screen_rect(RID p_viewport,const Rect2& p_rect); + virtual void viewport_queue_screen_capture(RID p_viewport); virtual Image viewport_get_screen_capture(RID p_viewport) const; @@ -991,6 +996,7 @@ public: virtual void viewport_set_hide_scenario(RID p_viewport,bool p_hide); virtual void viewport_set_hide_canvas(RID p_viewport,bool p_hide); + virtual void viewport_set_disable_environment(RID p_viewport,bool p_disable); virtual void viewport_attach_camera(RID p_viewport,RID p_camera); virtual void viewport_set_scenario(RID p_viewport,RID p_scenario); @@ -1122,6 +1128,7 @@ public: //virtual void canvas_item_set_rect(RID p_item, const Rect2& p_rect); virtual void canvas_item_set_transform(RID p_item, const Matrix32& p_transform); virtual void canvas_item_set_clip(RID p_item, bool p_clip); + virtual void canvas_item_set_distance_field_mode(RID p_item, bool p_enable); virtual void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2()); virtual void canvas_item_set_opacity(RID p_item, float p_opacity); virtual float canvas_item_get_opacity(RID p_item, float p_opacity) const; @@ -1149,6 +1156,7 @@ public: virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); virtual void canvas_item_set_z(RID p_item, int p_z); virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable); + virtual void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect); virtual void canvas_item_set_material(RID p_item, RID p_material); virtual void canvas_item_set_use_parent_material(RID p_item, bool p_enable); @@ -1157,16 +1165,18 @@ public: virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas); virtual void canvas_light_set_enabled(RID p_light, bool p_enabled); virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform); + virtual void canvas_light_set_scale(RID p_light, float p_scale); virtual void canvas_light_set_texture(RID p_light, RID p_texture); virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset); virtual void canvas_light_set_color(RID p_light, const Color& p_color); virtual void canvas_light_set_height(RID p_light, float p_height); + virtual void canvas_light_set_energy(RID p_light, float p_energy); virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z); virtual void canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer); virtual void canvas_light_set_item_mask(RID p_light, int p_mask); virtual void canvas_light_set_item_shadow_mask(RID p_light, int p_mask); - virtual void canvas_light_set_subtract_mode(RID p_light, bool p_enable); + virtual void canvas_light_set_mode(RID p_light, CanvasLightMode p_mode); virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled); virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size); virtual void canvas_light_set_shadow_esm_multiplier(RID p_light, float p_multiplier); @@ -1195,8 +1205,9 @@ public: virtual RID canvas_item_material_create(); virtual void canvas_item_material_set_shader(RID p_material, RID p_shader); virtual void canvas_item_material_set_shader_param(RID p_material, const StringName& p_param, const Variant& p_value); - virtual Variant canvas_item_material_get_shader_param(RID p_material, const StringName& p_param) const; - virtual void canvas_item_material_set_unshaded(RID p_material, bool p_unshaded); + virtual Variant canvas_item_material_get_shader_param(RID p_material, const StringName& p_param) const; + virtual void canvas_item_material_set_shading_mode(RID p_material, CanvasItemShadingMode p_mode); + /* CURSOR */ diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index bccb096e1b..6cd374aa08 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -982,6 +982,7 @@ public: FUNC2(viewport_set_hide_canvas,RID,bool ); FUNC2(viewport_attach_camera,RID,RID ); FUNC2(viewport_set_scenario,RID,RID ); + FUNC2(viewport_set_disable_environment,RID,bool ); FUNC1RC(RID,viewport_get_attached_camera,RID); FUNC1RC(RID,viewport_get_scenario,RID ); @@ -1108,6 +1109,7 @@ public: //FUNC(canvas_item_set_rect,RID, const Rect2& p_rect); FUNC2(canvas_item_set_transform,RID, const Matrix32& ); FUNC2(canvas_item_set_clip,RID, bool ); + FUNC2(canvas_item_set_distance_field_mode,RID, bool ); FUNC3(canvas_item_set_custom_rect,RID, bool ,const Rect2&); FUNC2(canvas_item_set_opacity,RID, float ); FUNC2RC(float,canvas_item_get_opacity,RID, float ); @@ -1138,6 +1140,8 @@ public: FUNC2(canvas_item_set_sort_children_by_y,RID,bool); FUNC2(canvas_item_set_z,RID,int); FUNC2(canvas_item_set_z_as_relative_to_parent,RID,bool); + FUNC3(canvas_item_set_copy_to_backbuffer,RID,bool,const Rect2&); + FUNC2(canvas_item_set_material,RID, RID ); @@ -1151,16 +1155,18 @@ public: FUNC2(canvas_light_attach_to_canvas,RID,RID); FUNC2(canvas_light_set_enabled,RID,bool); FUNC2(canvas_light_set_transform,RID,const Matrix32&); + FUNC2(canvas_light_set_scale,RID,float); FUNC2(canvas_light_set_texture,RID,RID); FUNC2(canvas_light_set_texture_offset,RID,const Vector2&); FUNC2(canvas_light_set_color,RID,const Color&); FUNC2(canvas_light_set_height,RID,float); + FUNC2(canvas_light_set_energy,RID,float); FUNC3(canvas_light_set_layer_range,RID,int,int); FUNC3(canvas_light_set_z_range,RID,int,int); FUNC2(canvas_light_set_item_mask,RID,int); FUNC2(canvas_light_set_item_shadow_mask,RID,int); - FUNC2(canvas_light_set_subtract_mode,RID,bool); + FUNC2(canvas_light_set_mode,RID,CanvasLightMode); FUNC2(canvas_light_set_shadow_enabled,RID,bool); FUNC2(canvas_light_set_shadow_buffer_size,RID,int); FUNC2(canvas_light_set_shadow_esm_multiplier,RID,float); @@ -1186,8 +1192,8 @@ public: FUNC0R(RID,canvas_item_material_create); FUNC2(canvas_item_material_set_shader,RID,RID); FUNC3(canvas_item_material_set_shader_param,RID,const StringName&,const Variant&); - FUNC2RC(Variant,canvas_item_material_get_shader_param,RID,const StringName&); - FUNC2(canvas_item_material_set_unshaded,RID,bool); + FUNC2RC(Variant,canvas_item_material_get_shader_param,RID,const StringName&); + FUNC2(canvas_item_material_set_shading_mode,RID,CanvasItemShadingMode); /* CURSOR */ FUNC2(cursor_set_rotation,float , int ); // radians |