From 544ce2a1dbaa5548490c975c2f6f6ed7c21377b9 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 12 Jan 2015 10:19:09 -0300 Subject: -Initial working(?) implementation of shaders for 2D. Lighting still not there though. Check for reference: https://github.com/okamstudio/godot/wiki/shader --- drivers/gles2/rasterizer_gles2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gles2/rasterizer_gles2.h') diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index f0dae00b53..65947fb034 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -192,6 +192,7 @@ class RasterizerGLES2 : public Rasterizer { bool uses_discard; bool uses_time; bool uses_normal; + bool uses_texpixel_size; Map uniforms; StringName first_texture; @@ -1171,6 +1172,8 @@ class RasterizerGLES2 : public Rasterizer { GLuint white_tex; RID canvas_tex; float canvas_opacity; + bool uses_texpixel_size; + bool rebind_texpixel_size; _FORCE_INLINE_ Texture* _bind_canvas_texture(const RID& p_texture); VS::MaterialBlendMode canvas_blend_mode; @@ -1262,6 +1265,8 @@ public: virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; + virtual Variant shader_get_default_param(RID p_shader, const StringName& p_name); + /* COMMON MATERIAL API */ virtual RID material_create(); -- cgit v1.2.3 From 30d36581100f0bf71c6d2502be9a03443bdf8708 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 12 Jan 2015 20:44:02 -0300 Subject: -fixed issue with shader not being reset on layers, closes #1199 -ability for shader to use parent shader and params, closes #1198 --- drivers/gles2/rasterizer_gles2.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gles2/rasterizer_gles2.h') diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index 65947fb034..0f77d18dee 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -1174,6 +1174,11 @@ class RasterizerGLES2 : public Rasterizer { float canvas_opacity; bool uses_texpixel_size; bool rebind_texpixel_size; + Transform canvas_transform; + RID canvas_last_shader; + bool canvas_texscreen_used; + + _FORCE_INLINE_ Texture* _bind_canvas_texture(const RID& p_texture); VS::MaterialBlendMode canvas_blend_mode; @@ -1542,6 +1547,7 @@ public: virtual void canvas_draw_primitive(const Vector& p_points, const Vector& p_colors,const Vector& p_uvs, RID p_texture,float p_width); virtual void canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor); virtual void canvas_set_transform(const Matrix32& p_transform); + virtual void canvas_render_items(CanvasItem *p_item_list); /* ENVIRONMENT */ -- cgit v1.2.3