|
- #ifdef OPENGL_ES
- #ifdef GL_FRAGMENT_PRECISION_HIGH
- precision highp float;
- #else
- precision mediump float;
- #endif
- #endif
-
- uniform vec4 u_outlineColor;
- // Varyings
- varying vec2 v_texCoord;
- uniform sampler2D u_diffuseTexture;
-
- // alphareject
- #if defined(TEXTURE_DISCARD_ALPHA)
- uniform float u_alphaReject;
- #endif
-
- #if defined(MODULATE_COLOR)
- uniform vec4 u_modulateColor;
- #endif
-
- #if defined(ADDITIVE_COLOR)
- uniform vec4 u_additiveColor;
- #endif
-
- #if defined(BLEND_COLOR)
- uniform vec4 u_blendColor;
- #endif
-
- // 描边不需要半透明
- //#if defined(MODULATE_ALPHA)
- //uniform float u_modulateAlpha;
- //#endif
-
-
- void main(void)
- {
- vec4 texColor = texture2D(u_diffuseTexture, v_texCoord);
-
- #if defined(TEXTURE_DISCARD_ALPHA)
- if (texColor.a < u_alphaReject)
- discard;
- #endif
-
- gl_FragColor = u_outlineColor;
-
- #if defined(MODULATE_COLOR)
- gl_FragColor *= u_modulateColor;
- #endif
-
- #if defined(ADDITIVE_COLOR)
- gl_FragColor += u_additiveColor;
- #endif
-
- #if defined(BLEND_COLOR)
- gl_FragColor.rgb = mix(gl_FragColor.rgb , u_blendColor.rgb , u_blendColor.a);
- #endif
-
- //#if defined(MODULATE_ALPHA)
- //gl_FragColor.a *= u_modulateAlpha;
- //#endif
- }
|