Open NightMachinery opened 6 years ago
Yup, what I do is a manual work-around:
#version 330
before the shader
#ifdef GL_ES
precision mediump float;
#endif
- rename `gl_FragColor` to `fragColor`
- add `out vec4 fragColor` to the fragment shader
It's because we create a Desktop OpenGL context, not WebGL or OpenGL ES.
Your shader, fixed:
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
out vec4 fragColor;
void main( void ) {
//vec2 m = vec2(mouse.x * 2.0 - 1.0, -mouse.y * 2.0 + 1.0);
vec2 p = (gl_FragCoord.xy * 2.0 - resolution) / min(resolution.x, resolution.y);
// ring
float t = 0.12* abs(sin(time*cos(time)*0.06)+0.2) / abs(0.5 - length(p));
fragColor = vec4(vec3(t), 1.0);
}
Thank you. ❤️
On Wed, Aug 8, 2018 at 1:03 AM Guillaume Piolat notifications@github.com wrote:
Your shader, fixed:
uniform float time; uniform vec2 mouse; uniform vec2 resolution; out vec4 fragColor;
void main( void ) {
//vec2 m = vec2(mouse.x * 2.0 - 1.0, -mouse.y * 2.0 + 1.0); vec2 p = (gl_FragCoord.xy * 2.0 - resolution) / min(resolution.x, resolution.y); // ring float t = 0.12* abs(sin(time*cos(time)*0.06)+0.2) / abs(0.5 - length(p));
fragColor = vec4(vec3(t), 1.0);
}
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/p0nce/y4m-tools/issues/5#issuecomment-411192674, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--goUxT68J71wSHKzkDxl_o4sPAXUks5uOfmjgaJpZM4VyMUf .
Reopen since the README says "out of the box" well not on macOS
My shader: