Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent malfunction on the web version #44

Closed
riccardoscalco opened this issue Jun 15, 2018 · 6 comments
Closed

Recent malfunction on the web version #44

riccardoscalco opened this issue Jun 15, 2018 · 6 comments

Comments

@riccardoscalco
Copy link

Hi, I am using a lot the editor at http://editor.thebookofshaders.com/.

Unfortunately recently I noted a malfunction, my shaders do not work anymore.
I can open the editor and the initial shader is visible, but if I change the code the canvas is not updated.

The following shader for example does not work:

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;

void main() {
	vec2 st = gl_FragCoord.xy/u_resolution;
	gl_FragColor = vec4(st, 1., 1.);
}

I tested the editor in Chrome, Safari and Firefox in macos.

Thanks for your work, I really appreciate.

@patriciogonzalezvivo
Copy link
Owner

Hi @riccardoscalco, I think I know where the problem originates... what happen if you change the size of the viewport?

Yesterday I detect a bug on GlslCanvas where doesn't render shader with no animation. The lack of u_time or u_mouse usually triggers a flag where the shader is only rendered when something change... and not constantly. I will take a look to that today

@riccardoscalco
Copy link
Author

Probably your intuition is correct, this code works as expected:

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform float u_time;

void main() {
    vec2 st = gl_FragCoord.xy/u_resolution;
    gl_FragColor = vec4(st, 1.0, u_time);
}

There is no hurry on my side, thanks for the effort.

@harry-isaac
Copy link

Hey, just wanted to +1 this and say I'm experiencing the issue too. A quick work around I realized, as you mentioned, is to add u_time somewhere. Doesn't even need to be in code, can be in a comment. So for now I'm just adding it to the top of my shaders like this:

//u_time

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform float u_time;

void main() {
    vec2 st = gl_FragCoord.xy/u_resolution;
    gl_FragColor = vec4(st, 0.0, 1.0);
}

@patriciogonzalezvivo
Copy link
Owner

Hi! sorry for this regression. I'll work on it

@patriciogonzalezvivo
Copy link
Owner

Ok... I think now is fixed @harryslotwiner @riccardoscalco could you give it a try?

@riccardoscalco
Copy link
Author

@patriciogonzalezvivo I confirm, it works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants