diff options
Diffstat (limited to 'drivers/gles2/rasterizer_canvas_gles2.h')
-rw-r--r-- | drivers/gles2/rasterizer_canvas_gles2.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h index cf1c239b6e..221427198a 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.h +++ b/drivers/gles2/rasterizer_canvas_gles2.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ + #ifndef RASTERIZERCANVASGLES2_H #define RASTERIZERCANVASGLES2_H @@ -36,12 +37,16 @@ #include "shaders/canvas.glsl.gen.h" #include "shaders/lens_distorted.glsl.gen.h" -// #include "shaders/canvas_shadow.glsl.gen.h" +#include "shaders/canvas_shadow.glsl.gen.h" class RasterizerSceneGLES2; class RasterizerCanvasGLES2 : public RasterizerCanvas { public: + enum { + INSTANCE_ATTRIB_BASE = 8, + }; + struct Uniforms { Transform projection_matrix; @@ -70,17 +75,24 @@ public: Uniforms uniforms; bool canvas_texscreen_used; CanvasShaderGLES2 canvas_shader; - // CanvasShadowShaderGLES3 canvas_shadow_shader; + CanvasShadowShaderGLES2 canvas_shadow_shader; LensDistortedShaderGLES2 lens_shader; bool using_texture_rect; bool using_ninepatch; + bool using_skeleton; + + Transform2D skeleton_transform; + Transform2D skeleton_transform_inverse; + Vector2i skeleton_texture_size; RID current_tex; RID current_normal; RasterizerStorageGLES2::Texture *current_tex_ptr; Transform vp; + Light *using_light; + bool using_shadow; } state; @@ -90,6 +102,8 @@ public: RasterizerStorageGLES2 *storage; + bool use_nvidia_rect_workaround; + virtual RID light_internal_create(); virtual void light_internal_update(RID p_rid, Light *p_light); virtual void light_internal_free(RID p_rid); @@ -99,10 +113,8 @@ public: virtual void canvas_begin(); virtual void canvas_end(); - _FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable, bool p_ninepatch = false); - _FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs); - _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor); + _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor, const float *p_weights = NULL, const int *p_bones = NULL); _FORCE_INLINE_ void _draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor); _FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip, RasterizerStorageGLES2::Material *p_material); |