double-hit-balls/assets/SSAA_4X.frag
Vladislav Khorev Dev ed4a0178da SSAA 4X demo
2017-12-02 15:25:02 +05:00

18 lines
342 B
GLSL
Executable File

precision mediump float;
uniform sampler2D Texture;
uniform vec2 samplesOffset[4];
varying vec2 texCoord;
void main()
{
vec3 color = vec3(0, 0, 0);
for (int i = 0; i < 4; ++i)
{
color += texture2D(Texture, texCoord + samplesOffset[i]).rgb;
}
color /= 4;
gl_FragColor = vec4(texture2D(Texture, texCoord ), 1.0);
}