precision highp float; #include #include #include #include #include #include in vec4 a_color; #if HAS_SECOND_UV in vec2 a_texCoord1; #endif out vec3 v_position; out vec3 v_normal; out vec3 v_tangent; out vec3 v_bitangent; out vec2 v_uv; out vec2 v_uv1; out vec4 v_color; vec4 vert () { StandardVertInput In; CCVertInput(In); mat4 matWorld, matWorldIT; CCGetWorldMatrixFull(matWorld, matWorldIT); vec4 pos = matWorld * In.position; v_position = pos.xyz; v_normal = normalize((matWorldIT * vec4(In.normal, 0.0)).xyz); v_tangent = normalize((matWorld * vec4(In.tangent.xyz, 0.0)).xyz); v_bitangent = cross(v_normal, v_tangent) * In.tangent.w; // note the cross order v_uv = a_texCoord; #if HAS_SECOND_UV v_uv1 = a_texCoord1; #endif v_color = a_color; CC_TRANSFER_FOG(pos); CC_TRANSFER_SHADOW(pos); #if CC_USE_2D return cc_matProj * cc_matView * In.position; #else return cc_matProj * (cc_matView * matWorld) * In.position; #endif }