Added support for shaders written in non-legacy GLSL.

This commit is contained in:
binary1248 2018-05-20 14:06:24 +02:00
parent 1dcad60878
commit db7e683688
No known key found for this signature in database
GPG key ID: E5E52A5D6082224A
18 changed files with 690 additions and 74 deletions

View file

@ -1,9 +1,12 @@
uniform sampler2D texture;
uniform float pixel_threshold;
varying vec4 texCoord;
varying vec4 frontColor;
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;
vec2 pos = floor(texCoord.xy * factor + 0.5) / factor;
gl_FragColor = texture2D(texture, pos) * frontColor;
}