1uniform mat4 g_WorldViewProjectionMatrix; 2attribute vec3 inPosition; 3 4#if defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD)) 5 #define NEED_TEXCOORD1 6#endif 7 8#ifdef NEED_TEXCOORD1 9 attribute vec3 inTexCoord; 10 varying vec3 texCoord1; 11#endif 12 13#ifdef SEPARATE_TEXCOORD 14 attribute vec3 inTexCoord2; 15 varying vec3 texCoord2; 16#endif 17 18#ifdef HAS_VERTEXCOLOR 19 attribute vec4 inColor; 20 varying vec4 vertColor; 21#endif 22 23void main(){ 24 #ifdef NEED_TEXCOORD1 25 texCoord1 = inTexCoord; 26 #endif 27 28 #ifdef SEPARATE_TEXCOORD 29 texCoord2 = inTexCoord2; 30 #endif 31 32 #ifdef HAS_VERTEXCOLOR 33 vertColor = inColor; 34 #endif 35 36 gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0); 37} 38 39