diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 12ff43479bfe..baa7e664b5c3 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -235,7 +235,7 @@ FRAGMENT_SHADER_CODE #if defined(USE_LIGHT_SHADER_CODE) //light is written by the light shader { - vec4 light_out=vec4(0.0,0.0,0.0,0.0); + vec4 light_out=light*color; LIGHT_SHADER_CODE color=light_out; } diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 18747734abf0..8199e7c622c4 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1546,7 +1546,7 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() { quit_request=false; orientation=0; remove_prev=true; - use_32_fb=false; + use_32_fb=true; device_thread=Thread::create(_device_poll_thread,this); devices_changed=true; diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 7bc8f61744f1..1aabf5337b5a 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -56,7 +56,6 @@ void OS_Server::initialize(const VideoMode& p_desired,int p_video_driver,int p_a args=OS::get_singleton()->get_cmdline_args(); current_videomode=p_desired; main_loop=NULL; - rasterizer = memnew( RasterizerDummy ); @@ -163,6 +162,12 @@ OS::VideoMode OS_Server::get_video_mode(int p_screen) const { return current_videomode; } + +Size2 OS_Server::get_window_size() const { + + return Vector2(current_videomode.width,current_videomode.height) ; +} + void OS_Server::get_fullscreen_mode_list(List *p_list,int p_screen) const { diff --git a/platform/server/os_server.h b/platform/server/os_server.h index fcf96253ad8c..f8d346ce48a9 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -109,6 +109,8 @@ class OS_Server : public OS_Unix { virtual VideoMode get_video_mode(int p_screen=0) const; virtual void get_fullscreen_mode_list(List *p_list,int p_screen=0) const; + virtual Size2 get_window_size() const; + virtual void move_window_to_foreground(); void run(); diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index b0d9ceee0e77..be54d649e21a 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 *r_slots) { diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp index 7fb8eb02fcf9..45b29f5484fc 100644 --- a/servers/visual/rasterizer_dummy.cpp +++ b/servers/visual/rasterizer_dummy.cpp @@ -1543,11 +1543,38 @@ void RasterizerDummy::end_shadow_map() { void RasterizerDummy::end_frame() { +} + +RID RasterizerDummy::canvas_light_occluder_create() { + return RID(); +} + +void RasterizerDummy::canvas_light_occluder_set_polylines(RID p_occluder, const DVector& 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 baa48951d650..99c76a191713 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -696,6 +696,7 @@ class RasterizerDummy : public Rasterizer { /* 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 @@ class RasterizerDummy : public Rasterizer { 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& 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 @@ class RasterizerDummy : public Rasterizer { 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/version.py b/version.py index 86601a22f25d..46490c48f4dc 100644 --- a/version.py +++ b/version.py @@ -1,7 +1,7 @@ short_name="godot" name="Godot Engine" major=1 -minor=0 -status="stable" +minor=1 +status="beta1"