diff --git a/cocos/3d/CCBundle3D.cpp b/cocos/3d/CCBundle3D.cpp index da8ff0fea4..8ee8ecb374 100644 --- a/cocos/3d/CCBundle3D.cpp +++ b/cocos/3d/CCBundle3D.cpp @@ -2031,6 +2031,30 @@ unsigned int Bundle3D::parseGLProgramAttribute(const std::string& str) { return GLProgram::VERTEX_ATTRIB_TEX_COORD1; } + else if (str == "VERTEX_ATTRIB_TEX_COORD2") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD2; + } + else if (str == "VERTEX_ATTRIB_TEX_COORD3") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD3; + } + else if (str == "VERTEX_ATTRIB_TEX_COORD4") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD4; + } + else if (str == "VERTEX_ATTRIB_TEX_COORD5") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD5; + } + else if (str == "VERTEX_ATTRIB_TEX_COORD6") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD6; + } + else if (str == "VERTEX_ATTRIB_TEX_COORD7") + { + return GLProgram::VERTEX_ATTRIB_TEX_COORD7; + } else if (str == "VERTEX_ATTRIB_NORMAL") { return GLProgram::VERTEX_ATTRIB_NORMAL; diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 93d9828ae5..5ee02715ac 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -46,7 +46,7 @@ NS_CC_BEGIN -std::string s_attributeNames[] = {GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT, GLProgram::ATTRIBUTE_NAME_BLEND_INDEX}; +std::string s_attributeNames[] = {GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::ATTRIBUTE_NAME_TEX_COORD2,GLProgram::ATTRIBUTE_NAME_TEX_COORD3,GLProgram::ATTRIBUTE_NAME_TEX_COORD4,GLProgram::ATTRIBUTE_NAME_TEX_COORD5,GLProgram::ATTRIBUTE_NAME_TEX_COORD6,GLProgram::ATTRIBUTE_NAME_TEX_COORD7,GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT, GLProgram::ATTRIBUTE_NAME_BLEND_INDEX}; Sprite3D* Sprite3D::create(const std::string &modelPath) { diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 8a6d786731..4b757c5b0f 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -95,6 +95,12 @@ const char* GLProgram::ATTRIBUTE_NAME_COLOR = "a_color"; const char* GLProgram::ATTRIBUTE_NAME_POSITION = "a_position"; const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD = "a_texCoord"; const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD1 = "a_texCoord1"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD2 = "a_texCoord2"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD3 = "a_texCoord3"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD4 = "a_texCoord4"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD5 = "a_texCoord5"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD6 = "a_texCoord6"; +const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD7 = "a_texCoord7"; const char* GLProgram::ATTRIBUTE_NAME_NORMAL = "a_normal"; const char* GLProgram::ATTRIBUTE_NAME_BLEND_WEIGHT = "a_blendWeight"; const char* GLProgram::ATTRIBUTE_NAME_BLEND_INDEX = "a_blendIndex"; @@ -283,6 +289,12 @@ void GLProgram::bindPredefinedVertexAttribs() {GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR}, {GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORD}, {GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::VERTEX_ATTRIB_TEX_COORD1}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD2, GLProgram::VERTEX_ATTRIB_TEX_COORD2}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD3, GLProgram::VERTEX_ATTRIB_TEX_COORD3}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD4, GLProgram::VERTEX_ATTRIB_TEX_COORD4}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD5, GLProgram::VERTEX_ATTRIB_TEX_COORD5}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD6, GLProgram::VERTEX_ATTRIB_TEX_COORD6}, + {GLProgram::ATTRIBUTE_NAME_TEX_COORD7, GLProgram::VERTEX_ATTRIB_TEX_COORD7}, {GLProgram::ATTRIBUTE_NAME_NORMAL, GLProgram::VERTEX_ATTRIB_NORMAL}, }; diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index 973c2d8d6d..d73519562f 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -85,6 +85,12 @@ public: VERTEX_ATTRIB_COLOR, VERTEX_ATTRIB_TEX_COORD, VERTEX_ATTRIB_TEX_COORD1, + VERTEX_ATTRIB_TEX_COORD2, + VERTEX_ATTRIB_TEX_COORD3, + VERTEX_ATTRIB_TEX_COORD4, + VERTEX_ATTRIB_TEX_COORD5, + VERTEX_ATTRIB_TEX_COORD6, + VERTEX_ATTRIB_TEX_COORD7, VERTEX_ATTRIB_NORMAL, VERTEX_ATTRIB_BLEND_WEIGHT, VERTEX_ATTRIB_BLEND_INDEX, @@ -154,6 +160,12 @@ public: static const char* ATTRIBUTE_NAME_POSITION; static const char* ATTRIBUTE_NAME_TEX_COORD; static const char* ATTRIBUTE_NAME_TEX_COORD1; + static const char* ATTRIBUTE_NAME_TEX_COORD2; + static const char* ATTRIBUTE_NAME_TEX_COORD3; + static const char* ATTRIBUTE_NAME_TEX_COORD4; + static const char* ATTRIBUTE_NAME_TEX_COORD5; + static const char* ATTRIBUTE_NAME_TEX_COORD6; + static const char* ATTRIBUTE_NAME_TEX_COORD7; static const char* ATTRIBUTE_NAME_NORMAL; static const char* ATTRIBUTE_NAME_BLEND_WEIGHT; static const char* ATTRIBUTE_NAME_BLEND_INDEX;