From 35b404ba085819e5cd5f432b7c00ef3167523bb7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 12 Jan 2017 08:34:00 -0300 Subject: Unify naming of blendshape / morphtarget into just "Blend Shape" --- drivers/gles3/rasterizer_scene_gles3.cpp | 4 +-- drivers/gles3/rasterizer_storage_gles3.cpp | 42 +++++++++++++++--------------- drivers/gles3/rasterizer_storage_gles3.h | 20 +++++++------- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'drivers/gles3') diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 5611b4b63a..5e0f439e3e 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1251,9 +1251,9 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) { RasterizerStorageGLES3::Surface *s = static_cast(e->geometry); - if (s->morph_targets.size() && e->instance->morph_values.size()) { + if (s->blend_shapes.size() && e->instance->blend_values.size()) { //blend shapes, use transform feedback - storage->mesh_render_blend_shapes(s,e->instance->morph_values.ptr()); + storage->mesh_render_blend_shapes(s,e->instance->blend_values.ptr()); //rebind shader state.scene_shader.bind(); } else { diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a4fea29b47..f096719988 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2480,7 +2480,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P } - bool has_morph = p_blend_shapes.size(); + //bool has_morph = p_blend_shapes.size(); Surface::Attrib attribs[VS::ARRAY_MAX]; @@ -2702,7 +2702,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P ERR_FAIL_COND(p_index_array.size()!=index_array_size); - ERR_FAIL_COND(p_blend_shapes.size()!=mesh->morph_target_count); + ERR_FAIL_COND(p_blend_shapes.size()!=mesh->blend_shape_count); for(int i=0;i::Read vr = p_blend_shapes[i].read(); @@ -2837,7 +2837,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P glBindVertexArray(0); glBindBuffer(GL_ARRAY_BUFFER,0); //unbind - surface->morph_targets.push_back(mt); + surface->blend_shapes.push_back(mt); } } @@ -2846,7 +2846,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P mesh->instance_change_notify(); } -void RasterizerStorageGLES3::mesh_set_morph_target_count(RID p_mesh,int p_amount){ +void RasterizerStorageGLES3::mesh_set_blend_shape_count(RID p_mesh,int p_amount){ Mesh *mesh = mesh_owner.getornull(p_mesh); ERR_FAIL_COND(!mesh); @@ -2855,32 +2855,32 @@ void RasterizerStorageGLES3::mesh_set_morph_target_count(RID p_mesh,int p_amount ERR_FAIL_COND(mesh->surfaces.size()!=0); ERR_FAIL_COND(p_amount<0); - mesh->morph_target_count=p_amount; + mesh->blend_shape_count=p_amount; } -int RasterizerStorageGLES3::mesh_get_morph_target_count(RID p_mesh) const{ +int RasterizerStorageGLES3::mesh_get_blend_shape_count(RID p_mesh) const{ const Mesh *mesh = mesh_owner.getornull(p_mesh); ERR_FAIL_COND_V(!mesh,0); - return mesh->morph_target_count; + return mesh->blend_shape_count; } -void RasterizerStorageGLES3::mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode){ +void RasterizerStorageGLES3::mesh_set_blend_shape_mode(RID p_mesh,VS::BlendShapeMode p_mode){ Mesh *mesh = mesh_owner.getornull(p_mesh); ERR_FAIL_COND(!mesh); - mesh->morph_target_mode=p_mode; + mesh->blend_shape_mode=p_mode; } -VS::MorphTargetMode RasterizerStorageGLES3::mesh_get_morph_target_mode(RID p_mesh) const{ +VS::BlendShapeMode RasterizerStorageGLES3::mesh_get_blend_shape_mode(RID p_mesh) const{ const Mesh *mesh = mesh_owner.getornull(p_mesh); - ERR_FAIL_COND_V(!mesh,VS::MORPH_MODE_NORMALIZED); + ERR_FAIL_COND_V(!mesh,VS::BLEND_SHAPE_MODE_NORMALIZED); - return mesh->morph_target_mode; + return mesh->blend_shape_mode; } void RasterizerStorageGLES3::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material){ @@ -3027,9 +3027,9 @@ Vector > RasterizerStorageGLES3::mesh_surface_get_blend_shap Vector > bsarr; - for(int i=0;isurfaces[p_surface]->morph_targets.size();i++) { + for(int i=0;isurfaces[p_surface]->blend_shapes.size();i++) { - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,mesh->surfaces[p_surface]->morph_targets[i].vertex_id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,mesh->surfaces[p_surface]->blend_shapes[i].vertex_id); void * data = glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER,0,mesh->surfaces[p_surface]->array_byte_size,GL_MAP_READ_BIT); ERR_FAIL_COND_V(!data,Vector >()); @@ -3081,10 +3081,10 @@ void RasterizerStorageGLES3::mesh_remove_surface(RID p_mesh, int p_surface){ glDeleteVertexArrays(1,&surface->array_id); - for(int i=0;imorph_targets.size();i++) { + for(int i=0;iblend_shapes.size();i++) { - glDeleteBuffers(1,&surface->morph_targets[i].vertex_id); - glDeleteVertexArrays(1,&surface->morph_targets[i].array_id); + glDeleteBuffers(1,&surface->blend_shapes[i].vertex_id); + glDeleteVertexArrays(1,&surface->blend_shapes[i].array_id); } mesh->instance_material_change_notify(); @@ -3290,9 +3290,9 @@ void RasterizerStorageGLES3::mesh_render_blend_shapes(Surface *s, float *p_weigh //copy all first float base_weight=1.0; - int mtc = s->morph_targets.size(); + int mtc = s->blend_shapes.size(); - if (s->mesh->morph_target_mode==VS::MORPH_MODE_NORMALIZED) { + if (s->mesh->blend_shape_mode==VS::BLEND_SHAPE_MODE_NORMALIZED) { for(int i=0;imorph_targets[ti].array_id); + glBindVertexArray(s->blend_shapes[ti].array_id); glBindBuffer(GL_ARRAY_BUFFER, resources.transform_feedback_buffers[0]); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, resources.transform_feedback_buffers[1]); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 66593b202f..f9e440288f 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -531,12 +531,12 @@ public: //bool packed; - struct MorphTarget { + struct BlendShape { GLuint vertex_id; GLuint array_id; }; - Vector morph_targets; + Vector blend_shapes; Rect3 aabb; @@ -583,13 +583,13 @@ public: bool active; Vector surfaces; - int morph_target_count; - VS::MorphTargetMode morph_target_mode; + int blend_shape_count; + VS::BlendShapeMode blend_shape_mode; Rect3 custom_aabb; mutable uint64_t last_pass; Mesh() { - morph_target_mode=VS::MORPH_MODE_NORMALIZED; - morph_target_count=0; + blend_shape_mode=VS::BLEND_SHAPE_MODE_NORMALIZED; + blend_shape_count=0; last_pass=0; active=false; } @@ -601,12 +601,12 @@ public: virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector& p_array,int p_vertex_count,const PoolVector& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector >& p_blend_shapes=Vector >(),const Vector& p_bone_aabbs=Vector()); - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount); - virtual int mesh_get_morph_target_count(RID p_mesh) const; + virtual void mesh_set_blend_shape_count(RID p_mesh,int p_amount); + virtual int mesh_get_blend_shape_count(RID p_mesh) const; - virtual void mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode); - virtual VS::MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const; + virtual void mesh_set_blend_shape_mode(RID p_mesh,VS::BlendShapeMode p_mode); + virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const; virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material); virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; -- cgit v1.2.3