Home | History | Annotate | Download | only in texture
      1 uniform vec4 m_Color;
      2 
      3 #if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
      4     #define NEED_TEXCOORD1
      5 #endif
      6 
      7 #ifdef HAS_COLORMAP
      8     uniform sampler2DArray m_ColorMap;
      9 #endif
     10 
     11 #ifdef NEED_TEXCOORD1
     12     varying vec3 texCoord1;
     13 #endif
     14 
     15 #ifdef HAS_LIGHTMAP
     16     uniform sampler2D m_LightMap;
     17     #ifdef SEPERATE_TEXCOORD
     18         varying vec3 texCoord2;
     19     #endif
     20 #endif
     21 
     22 #ifdef HAS_VERTEXCOLOR
     23     varying vec4 vertColor;
     24 #endif
     25 
     26 void main(){
     27     vec4 color = vec4(1.0);
     28 
     29     #ifdef HAS_COLORMAP
     30         color *= texture2DArray(m_ColorMap, texCoord1);
     31     #endif
     32 
     33     #ifdef HAS_VERTEXCOLOR
     34         color *= vertColor;
     35     #endif
     36 
     37     #ifdef HAS_COLOR
     38         color *= m_Color;
     39     #endif
     40 
     41     #ifdef HAS_LIGHTMAP
     42         #ifdef SEPARATE_TEXCOORD
     43             color.rgb *= texture2D(m_LightMap, texCoord2).rgb;
     44         #else
     45             color.rgb *= texture2D(m_LightMap, texCoord1).rgb;
     46         #endif
     47     #endif
     48 
     49     gl_FragColor = color;
     50 }