axmol/tests/cpp-tests/Resources/Sprite3DTest/fog.frag

17 lines
354 B
GLSL
Raw Normal View History

2015-01-07 11:47:34 +08:00
#ifdef GL_ES
varying mediump vec2 v_texture_coord;
#else
varying vec2 v_texture_coord;
#endif
2015-01-07 17:58:10 +08:00
varying float v_fogFactor;
2015-01-07 11:47:34 +08:00
2015-01-07 17:58:10 +08:00
uniform vec4 u_fogColor;
2015-01-07 11:47:34 +08:00
2019-03-13 15:06:30 +08:00
uniform sampler2D u_texture;
2015-01-07 11:47:34 +08:00
void main (void)
{
2019-03-13 15:06:30 +08:00
vec4 finalColor = texture2D(u_texture, v_texture_coord);
2015-01-07 17:58:10 +08:00
gl_FragColor = mix(u_fogColor, finalColor, v_fogFactor ); //out put finalColor
2015-01-07 15:47:27 +08:00
}