Skip to content

Commit

Permalink
Beta1 Attempt #1
Browse files Browse the repository at this point in the history
-=-==-=-=-=-=-=-

-Small fixes in canvas item light shader
-Fixed compilation in server target
-Export for Android makes 32 bits display as default
-changed version to 1.1beta1
  • Loading branch information
reduz committed Apr 2, 2015
1 parent 1572238 commit 68e42f5
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/gles2/shaders/canvas.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion platform/android/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion platform/server/os_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -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<VideoMode> *p_list,int p_screen) const {


Expand Down
2 changes: 2 additions & 0 deletions platform/server/os_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<VideoMode> *p_list,int p_screen=0) const;

virtual Size2 get_window_size() const;

virtual void move_window_to_foreground();

void run();
Expand Down
15 changes: 12 additions & 3 deletions scene/resources/shader_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
32 changes: 32 additions & 0 deletions servers/visual/rasterizer_dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<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() {


Expand Down Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions servers/visual/rasterizer_dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<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();
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
short_name="godot"
name="Godot Engine"
major=1
minor=0
status="stable"
minor=1
status="beta1"


0 comments on commit 68e42f5

Please sign in to comment.