1#import "Common/ShaderLib/Texture.glsllib"
2
3varying vec2 texCoord;
4
5uniform sampler2D m_ColorMap;
6
7void main(){
8    //Texture_GetColor(m_ColorMap, texCoord)
9    //vec4 color = texture2D(m_ColorMap, texCoord);
10    //color.rgb *= color.a;
11    //gl_FragColor = vec4(color.a);
12
13    #ifdef NORMAL_LATC
14        vec3 newNorm = vec3(texture2D(m_ColorMap, texCoord).ag, 0.0);
15        newNorm = Common_UnpackNormal(newNorm);
16        newNorm.b = sqrt(1.0 - (newNorm.x * newNorm.x) - (newNorm.y * newNorm.y));
17        newNorm = Common_PackNormal(newNorm);
18        gl_FragColor = vec4(newNorm, 1.0);
19    #elif defined(SHOW_ALPHA)
20        gl_FragColor = vec4(texture2D(m_ColorMap, texCoord).a);
21    #else
22        gl_FragColor = Texture_GetColor(m_ColorMap, texCoord);
23    #endif
24    #ifdef NORMALIZE
25        gl_FragColor = vec4(normalize(gl_FragColor.xyz), gl_FragColor.a);
26    #endif
27}