diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/canvas_item.cpp | 33 | ||||
-rw-r--r-- | scene/2d/canvas_item.h | 15 | ||||
-rw-r--r-- | scene/2d/light_2d.cpp | 42 | ||||
-rw-r--r-- | scene/2d/light_2d.h | 18 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/visibility_notifier_2d.cpp | 7 | ||||
-rw-r--r-- | scene/3d/light.cpp | 2 | ||||
-rw-r--r-- | scene/3d/light.h | 2 | ||||
-rw-r--r-- | scene/3d/navigation.cpp | 6 | ||||
-rw-r--r-- | scene/3d/navigation.h | 2 | ||||
-rw-r--r-- | scene/gui/control.cpp | 2 | ||||
-rw-r--r-- | scene/main/scene_main_loop.cpp | 1 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 | ||||
-rw-r--r-- | scene/resources/shader_graph.cpp | 15 | ||||
-rw-r--r-- | scene/scene_string_names.cpp | 1 | ||||
-rw-r--r-- | scene/scene_string_names.h | 1 |
16 files changed, 109 insertions, 42 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index c3ff03d8f4..118ba33bc6 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -42,8 +42,8 @@ bool CanvasItemMaterial::_set(const StringName& p_name, const Variant& p_value) if (p_name==SceneStringNames::get_singleton()->shader_shader) { set_shader(p_value); return true; - } else if (p_name==SceneStringNames::get_singleton()->shader_unshaded) { - set_unshaded(p_value); + } else if (p_name==SceneStringNames::get_singleton()->shading_mode) { + set_shading_mode(ShadingMode(p_value.operator int())); return true; } else { @@ -74,10 +74,10 @@ bool CanvasItemMaterial::_get(const StringName& p_name,Variant &r_ret) const { r_ret=get_shader(); return true; - } else if (p_name==SceneStringNames::get_singleton()->shader_unshaded) { + } else if (p_name==SceneStringNames::get_singleton()->shading_mode) { - r_ret=unshaded; + r_ret=shading_mode; return true; } else { @@ -100,7 +100,7 @@ bool CanvasItemMaterial::_get(const StringName& p_name,Variant &r_ret) const { void CanvasItemMaterial::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::OBJECT, "shader/shader", PROPERTY_HINT_RESOURCE_TYPE,"CanvasItemShader,CanvasItemShaderGraph" ) ); - p_list->push_back( PropertyInfo( Variant::BOOL, "shader/unshaded") ); + p_list->push_back( PropertyInfo( Variant::INT, "shader/shading_mode",PROPERTY_HINT_ENUM,"Normal,Unshaded,Light Only") ); if (!shader.is_null()) { @@ -161,25 +161,30 @@ RID CanvasItemMaterial::get_rid() const { return material; } -void CanvasItemMaterial::set_unshaded(bool p_unshaded) { +void CanvasItemMaterial::set_shading_mode(ShadingMode p_mode) { - unshaded=p_unshaded; - VS::get_singleton()->canvas_item_material_set_unshaded(material,p_unshaded); + shading_mode=p_mode; + VS::get_singleton()->canvas_item_material_set_shading_mode(material,VS::CanvasItemShadingMode(p_mode)); } -bool CanvasItemMaterial::is_unshaded() const{ - - return unshaded; +CanvasItemMaterial::ShadingMode CanvasItemMaterial::get_shading_mode() const { + return shading_mode; } + void CanvasItemMaterial::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_shader","shader:Shader"),&CanvasItemMaterial::set_shader); ObjectTypeDB::bind_method(_MD("get_shader:Shader"),&CanvasItemMaterial::get_shader); ObjectTypeDB::bind_method(_MD("set_shader_param","param","value"),&CanvasItemMaterial::set_shader_param); ObjectTypeDB::bind_method(_MD("get_shader_param","param"),&CanvasItemMaterial::get_shader_param); - ObjectTypeDB::bind_method(_MD("set_unshaded","unshaded"),&CanvasItemMaterial::set_unshaded); - ObjectTypeDB::bind_method(_MD("is_unshaded"),&CanvasItemMaterial::is_unshaded); + ObjectTypeDB::bind_method(_MD("set_shading_mode","mode"),&CanvasItemMaterial::set_shading_mode); + ObjectTypeDB::bind_method(_MD("get_shading_mode"),&CanvasItemMaterial::get_shading_mode); + + BIND_CONSTANT( SHADING_NORMAL ); + BIND_CONSTANT( SHADING_UNSHADED ); + BIND_CONSTANT( SHADING_ONLY_LIGHT ); + } @@ -202,7 +207,7 @@ void CanvasItemMaterial::get_argument_options(const StringName& p_function,int p CanvasItemMaterial::CanvasItemMaterial() { material=VS::get_singleton()->canvas_item_material_create(); - unshaded=false; + shading_mode=SHADING_NORMAL; } CanvasItemMaterial::~CanvasItemMaterial(){ diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index c43642a8ec..167f2b96f3 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -45,10 +45,17 @@ class CanvasItemMaterial : public Resource{ OBJ_TYPE(CanvasItemMaterial,Resource); RID material; Ref<Shader> shader; - bool unshaded; +public: + enum ShadingMode { + SHADING_NORMAL, + SHADING_UNSHADED, + SHADING_ONLY_LIGHT, + }; protected: + ShadingMode shading_mode; + bool _set(const StringName& p_name, const Variant& p_value); bool _get(const StringName& p_name,Variant &r_ret) const; void _get_property_list( List<PropertyInfo> *p_list) const; @@ -66,14 +73,16 @@ public: void set_shader_param(const StringName& p_param,const Variant& p_value); Variant get_shader_param(const StringName& p_param) const; - void set_unshaded(bool p_unshaded); - bool is_unshaded() const; + void set_shading_mode(ShadingMode p_mode); + ShadingMode get_shading_mode() const; virtual RID get_rid() const; CanvasItemMaterial(); ~CanvasItemMaterial(); }; +VARIANT_ENUM_CAST( CanvasItemMaterial::ShadingMode ); + class CanvasItem : public Node { diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 4abb7e5436..c0ab544d42 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -96,6 +96,21 @@ float Light2D::get_height() const { return height; } +void Light2D::set_energy( float p_energy) { + + energy=p_energy; + VS::get_singleton()->canvas_light_set_energy(canvas_light,energy); + +} + + +float Light2D::get_energy() const { + + return energy; +} + + + void Light2D::set_texture_scale( float p_scale) { _scale=p_scale; @@ -178,15 +193,15 @@ int Light2D::get_item_shadow_mask() const { return item_shadow_mask; } -void Light2D::set_subtract_mode( bool p_enable ) { +void Light2D::set_mode( Mode p_mode ) { - subtract_mode=p_enable; - VS::get_singleton()->canvas_light_set_subtract_mode(canvas_light,p_enable); + mode=p_mode; + VS::get_singleton()->canvas_light_set_mode(canvas_light,VS::CanvasLightMode(p_mode)); } -bool Light2D::get_subtract_mode() const { +Light2D::Mode Light2D::get_mode() const { - return subtract_mode; + return mode; } void Light2D::set_shadow_enabled( bool p_enabled) { @@ -260,6 +275,9 @@ void Light2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_height","height"),&Light2D::set_height); ObjectTypeDB::bind_method(_MD("get_height"),&Light2D::get_height); + ObjectTypeDB::bind_method(_MD("set_energy","energy"),&Light2D::set_energy); + ObjectTypeDB::bind_method(_MD("get_energy"),&Light2D::get_energy); + ObjectTypeDB::bind_method(_MD("set_texture_scale","texture_scale"),&Light2D::set_texture_scale); ObjectTypeDB::bind_method(_MD("get_texture_scale"),&Light2D::get_texture_scale); @@ -283,8 +301,8 @@ void Light2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_item_shadow_mask","item_shadow_mask"),&Light2D::set_item_shadow_mask); ObjectTypeDB::bind_method(_MD("get_item_shadow_mask"),&Light2D::get_item_shadow_mask); - ObjectTypeDB::bind_method(_MD("set_subtract_mode","enable"),&Light2D::set_subtract_mode); - ObjectTypeDB::bind_method(_MD("get_subtract_mode"),&Light2D::get_subtract_mode); + ObjectTypeDB::bind_method(_MD("set_mode","mode"),&Light2D::set_mode); + ObjectTypeDB::bind_method(_MD("get_mode"),&Light2D::get_mode); ObjectTypeDB::bind_method(_MD("set_shadow_enabled","enabled"),&Light2D::set_shadow_enabled); ObjectTypeDB::bind_method(_MD("is_shadow_enabled"),&Light2D::is_shadow_enabled); @@ -300,7 +318,8 @@ void Light2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"scale",PROPERTY_HINT_RANGE,"0.01,4096,0.01"),_SCS("set_texture_scale"),_SCS("get_texture_scale")); ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"subtract"),_SCS("set_subtract_mode"),_SCS("get_subtract_mode")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy"),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Add,Sub,Mix"),_SCS("set_mode"),_SCS("get_mode")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"range/height"),_SCS("set_height"),_SCS("get_height")); ADD_PROPERTY( PropertyInfo(Variant::INT,"range/z_min",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_min"),_SCS("get_z_range_min")); ADD_PROPERTY( PropertyInfo(Variant::INT,"range/z_max",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_max"),_SCS("get_z_range_max")); @@ -312,6 +331,10 @@ void Light2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow/esm_multiplier",PROPERTY_HINT_RANGE,"1,4096,0.1"),_SCS("set_shadow_esm_multiplier"),_SCS("get_shadow_esm_multiplier")); ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow/item_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_item_shadow_mask"),_SCS("get_item_shadow_mask")); + BIND_CONSTANT( MODE_ADD ); + BIND_CONSTANT( MODE_SUB ); + BIND_CONSTANT( MODE_MIX ); + } @@ -329,9 +352,10 @@ Light2D::Light2D() { layer_max=0; item_mask=1; item_shadow_mask=1; - subtract_mode=false; + mode=MODE_ADD; shadow_buffer_size=2048; shadow_esm_multiplier=80; + energy=1.0; } diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 6cfb055fa9..ef875aec2f 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -6,6 +6,13 @@ class Light2D : public Node2D { OBJ_TYPE(Light2D,Node2D); +public: + enum Mode { + MODE_ADD, + MODE_SUB, + MODE_MIX, + }; + private: RID canvas_light; bool enabled; @@ -13,6 +20,7 @@ private: Color color; float height; float _scale; + float energy; int z_min; int z_max; int layer_min; @@ -21,7 +29,7 @@ private: int item_shadow_mask; int shadow_buffer_size; float shadow_esm_multiplier; - bool subtract_mode; + Mode mode; Ref<Texture> texture; Vector2 texture_offset; @@ -51,6 +59,9 @@ public: void set_height( float p_height); float get_height() const; + void set_energy( float p_energy); + float get_energy() const; + void set_texture_scale( float p_scale); float get_texture_scale() const; @@ -72,8 +83,8 @@ public: void set_item_shadow_mask( int p_mask); int get_item_shadow_mask() const; - void set_subtract_mode( bool p_enable ); - bool get_subtract_mode() const; + void set_mode( Mode p_mode ); + Mode get_mode() const; void set_shadow_enabled( bool p_enabled); bool is_shadow_enabled() const; @@ -90,5 +101,6 @@ public: ~Light2D(); }; +VARIANT_ENUM_CAST(Light2D::Mode); #endif // LIGHT_2D_H diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 22dd0f01d0..5457182ea7 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -1198,7 +1198,7 @@ void KinematicBody2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("move","rel_vec"),&KinematicBody2D::move); ObjectTypeDB::bind_method(_MD("move_to","position"),&KinematicBody2D::move_to); - ObjectTypeDB::bind_method(_MD("can_move_to","position"),&KinematicBody2D::can_move_to); + ObjectTypeDB::bind_method(_MD("can_move_to","position","discrete"),&KinematicBody2D::can_move_to,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("is_colliding"),&KinematicBody2D::is_colliding); diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index cd3c788b65..abaaf3262a 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -65,8 +65,13 @@ void VisibilityNotifier2D::_exit_viewport(Viewport* p_viewport){ void VisibilityNotifier2D::set_rect(const Rect2& p_rect){ rect=p_rect; - if (is_inside_tree()) + if (is_inside_tree()) { get_world_2d()->_update_notifier(this,get_global_transform().xform(rect)); + if (get_tree()->is_editor_hint()) { + update(); + item_rect_changed(); + } + } _change_notify("rect"); } diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 15e77e5378..037350f99a 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -669,7 +669,7 @@ void SpotLight::_bind_methods() { ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ATTENUATION ); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_angle", PROPERTY_HINT_RANGE, "0.01,89.9,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ANGLE ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "spot_attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); } diff --git a/scene/3d/light.h b/scene/3d/light.h index 6fb57a269b..5b10a4d816 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -49,7 +49,7 @@ public: PARAM_ENERGY=VisualServer::LIGHT_PARAM_ENERGY, PARAM_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION, PARAM_SPOT_ANGLE=VisualServer::LIGHT_PARAM_SPOT_ANGLE, - PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION, + PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_SPOT_ATTENUATION, PARAM_SHADOW_DARKENING=VisualServer::LIGHT_PARAM_SHADOW_DARKENING, PARAM_SHADOW_Z_OFFSET=VisualServer::LIGHT_PARAM_SHADOW_Z_OFFSET, PARAM_SHADOW_Z_SLOPE_SCALE=VisualServer::LIGHT_PARAM_SHADOW_Z_SLOPE_SCALE, diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index ce002fb44b..6612d6bf12 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -490,10 +490,10 @@ Vector<Vector3> Navigation::get_simple_path(const Vector3& p_start, const Vector } -Vector3 Navigation::get_closest_point_to_segment(const Vector3& p_from,const Vector3& p_to) { +Vector3 Navigation::get_closest_point_to_segment(const Vector3& p_from,const Vector3& p_to,const bool& p_use_collision) { - bool use_collision=false; + bool use_collision=p_use_collision; Vector3 closest_point; float closest_point_d=1e20; NavMesh *closest_navmesh=NULL; @@ -633,7 +633,7 @@ void Navigation::_bind_methods() { ObjectTypeDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); ObjectTypeDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","start","end"),&Navigation::get_closest_point_to_segment); + ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); ObjectTypeDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h index 69d48531a7..19977c3110 100644 --- a/scene/3d/navigation.h +++ b/scene/3d/navigation.h @@ -135,7 +135,7 @@ public: void navmesh_remove(int p_id); Vector<Vector3> get_simple_path(const Vector3& p_start, const Vector3& p_end,bool p_optimize=true); - Vector3 get_closest_point_to_segment(const Vector3& p_from,const Vector3& p_to); + Vector3 get_closest_point_to_segment(const Vector3& p_from,const Vector3& p_to,const bool& p_use_collision=false); Vector3 get_closest_point(const Vector3& p_point); Vector3 get_closest_point_normal(const Vector3& p_point); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 86f442fd8c..c539dc3284 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2869,7 +2869,7 @@ void Control::_bind_methods() { BIND_CONSTANT( SIZE_EXPAND_FILL ); ADD_SIGNAL( MethodInfo("resized") ); - ADD_SIGNAL( MethodInfo("input_event") ); + ADD_SIGNAL( MethodInfo("input_event",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); ADD_SIGNAL( MethodInfo("mouse_enter") ); ADD_SIGNAL( MethodInfo("mouse_exit") ); ADD_SIGNAL( MethodInfo("focus_enter") ); diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index ed3e419359..8e2dc93288 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -850,6 +850,7 @@ void SceneTree::queue_delete(Object *p_object) { _THREAD_SAFE_METHOD_ ERR_FAIL_NULL(p_object); + p_object->_is_queued_for_deletion = true; delete_queue.push_back(p_object->get_instance_ID()); } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ee400ae6d5..f0c71da153 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -406,7 +406,7 @@ void Viewport::_notification(int p_what) { int rc = ss2d->intersect_point(point,res,64,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF); for(int i=0;i<rc;i++) { - if (res[i].collider) { + if (res[i].collider_id && res[i].collider) { CollisionObject2D *co=res[i].collider->cast_to<CollisionObject2D>(); if (co) { diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index b0d9ceee0e..be54d649e2 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1351,15 +1351,24 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ {MODE_CANVAS_ITEM,SHADER_TYPE_FRAGMENT,"Normal","NORMAL","",SLOT_TYPE_VEC,SLOT_OUT}, //canvas item light in {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Color","COLOR.rgb","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Alpha","COLOR.a","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Normal","NORMAL","",SLOT_TYPE_VEC,SLOT_IN}, - {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightDist","LIGHT_DISTANCE","",SLOT_TYPE_SCALAR,SLOT_IN}, - {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightDir","vec3(LIGHT_DIR,0)","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"UV","vec3(UV,0)","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT_COLOR.rgb","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT_COLOR.a","",SLOT_TYPE_SCALAR,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightHeight","LIGHT_HEIGHT","",SLOT_TYPE_SCALAR,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"TexPixelSize","vec3(TEXTURE_PIXEL_SIZE,0)","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var1","VAR1.rgb","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var2","VAR2.rgb","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"PointCoord","POINT_COORD","",SLOT_TYPE_VEC,SLOT_IN}, //canvas item light out - {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Light","LIGHT","",SLOT_TYPE_VEC,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT.rgb","",SLOT_TYPE_VEC,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT.a","",SLOT_TYPE_SCALAR,SLOT_OUT}, //end {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,NULL,NULL,NULL,SLOT_TYPE_SCALAR,SLOT_OUT}, + + }; void ShaderGraph::get_input_output_node_slot_info(Mode p_mode, ShaderType p_type, List<SlotInfo> *r_slots) { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index d4159f0946..76cb5929cf 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -42,6 +42,7 @@ SceneStringNames::SceneStringNames() { input_event=StaticCString::create("input_event"); shader_shader=StaticCString::create("shader/shader"); shader_unshaded=StaticCString::create("shader/unshaded"); + shading_mode=StaticCString::create("shader/shading_mode"); enter_tree=StaticCString::create("enter_tree"); exit_tree=StaticCString::create("exit_tree"); item_rect_changed=StaticCString::create("item_rect_changed"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index aa29ef57dc..a69e8ba0b5 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -57,6 +57,7 @@ public: StringName item_rect_changed; StringName shader_shader; StringName shader_unshaded; + StringName shading_mode; StringName enter_tree; StringName exit_tree; StringName size_flags_changed; |