Upgrade shaders from GLSL 110 to 150 (OpenGL 3.2)

This commit is contained in:
Simran Brucherseifer
2020-04-22 11:28:33 +02:00
parent 26b928597c
commit 5da9848de7
14 changed files with 208 additions and 174 deletions
+13 -10
View File
@@ -1,29 +1,32 @@
// Adapted from "RGB Waveform" by lebek
// https://www.shadertoy.com/view/4dK3Wc
#version 110
#version 150
uniform sampler2D ove_maintex;
uniform vec2 ove_resolution;
varying vec2 ove_texcoord;
uniform float threshold;
in vec2 ove_texcoord;
out vec4 fragColor;
void main(void) {
vec3 col = vec3(0.0);
float s = ove_texcoord.y*1.8 - 0.15;
float maxb = s+threshold;
float minb = s-threshold;
float s = ove_texcoord.y * 1.8 - 0.15;
float maxb = s + threshold;
float minb = s - threshold;
int y_lim = int(ove_resolution.y);
for (int i = 0; i < y_lim; i++) {
vec3 x = texture2D(ove_maintex, vec2(ove_texcoord.x, float(i)/float(ove_resolution.y))).rgb;
col += step(x, vec3(maxb))*step(vec3(minb), x) / (ove_resolution.y * 0.125);
vec3 x = texture(ove_maintex, vec2(ove_texcoord.x, float(i) / float(ove_resolution.y))).rgb;
col += step(x, vec3(maxb)) * step(vec3(minb), x) / (ove_resolution.y * 0.125);
float l = dot(x, x);
col += step(l, maxb*maxb)*step(minb*minb, l) / (ove_resolution.y * 0.125);
col += step(l, maxb * maxb) * step(minb * minb, l) / (ove_resolution.y * 0.125);
}
gl_FragColor = vec4(col, 1.0);
fragColor = vec4(col, 1.0);
}