Added support for vertex shaders in sf::Shader

Rewrote the Shader example
This commit is contained in:
Laurent Gomila 2011-12-10 13:02:38 +01:00
parent 4d0a6a299a
commit c9b87ec8a9
20 changed files with 893 additions and 486 deletions

View file

@ -0,0 +1,9 @@
uniform sampler2D texture;
uniform float pixel_threshold;
void main()
{
float factor = 1.0 / (pixel_threshold + 0.001);
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
gl_FragColor = texture2D(texture, pos) * gl_Color;
}