latest version of processing2b8 shader issues
in
Programming Questions
•
7 months ago
i seem to have problems using shaders that worked in 2b4 but no longer work in the latest version
heres the shader that did work, but now no longer does. any ideas?
- uniform vec2 resolution;
- uniform float time;
- uniform sampler2D textureSampler0;
- void main(void)
- {
- vec2 q = gl_FragCoord.xy / resolution.xy;
- vec2 uv = gl_FragCoord.xy / resolution.xy;
- vec4 col;
- col.r = texture2D(textureSampler0,vec2(uv.x+0.003,uv.y)).x;
- col.g = texture2D(textureSampler0,vec2(uv.x+0.000,uv.y)).y;
- col.b = texture2D(textureSampler0,vec2(uv.x-0.003,uv.y)).z;
- col.a = 1;
- col = clamp(col*0.5+0.5*col*col*1.2,0.0,1.0);
- col *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y);
- //col *= vec3(0.8,1.0,0.7);
- col *= 0.9+0.1*sin(10.0*time+uv.y*1000.0);
- col *= 0.97+0.03*sin(110.0*time);
- //float comp = smoothstep( 0.2, 0.7, sin(time) );
- float bright = 0.1;
- float exposure = 0.5;
- float bright_threshold = 0.5;
- vec4 blurcol;
- //blurcol = texture2D(textureSampler0,vec2(uv.x,uv.y));
- blurcol = col;
- float lum = dot(vec4(0.30, 0.59, 0.11, 0.0), (blurcol) );
- if (lum > bright_threshold)
- blurcol = blurcol;
- else
- blurcol= vec4(0.0, 0.0, 0.0,0.0);
- vec2 offset ;
- offset.x = 0.01;
- offset.y = 0.01;
- blurcol = blurcol*4;
- blurcol += 2.0 * texture2D(textureSampler0, vec2(uv.x+offset.x,uv.y));
- blurcol += 2.0 * texture2D(textureSampler0, vec2(uv.x-offset.x,uv.y));
- blurcol += 2.0 * texture2D(textureSampler0, vec2(uv.x,uv.y+offset.y));
- blurcol += 2.0 * texture2D(textureSampler0, vec2(uv.x,uv.y-offset.y));
- blurcol += texture2D(textureSampler0, vec2(uv.x+offset.x,uv.y+offset.y));
- blurcol += texture2D(textureSampler0, vec2(uv.x-offset.x,uv.y+offset.y));
- blurcol += texture2D(textureSampler0, vec2(uv.x-offset.x,uv.y-offset.y));
- blurcol += texture2D(textureSampler0, vec2(uv.x-offset.x,uv.y+offset.y));
- blurcol = blurcol / 16;
- //gl_FragColor = vec4((col),1.0);
- gl_FragColor = vec4(col+(blurcol*0.5));
- }
1