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

The editor crashes when dividing uniforms by zero... #25

Open
demicuz opened this issue Jul 9, 2017 · 2 comments
Open

The editor crashes when dividing uniforms by zero... #25

demicuz opened this issue Jul 9, 2017 · 2 comments

Comments

@demicuz
Copy link

demicuz commented Jul 9, 2017

...And setting gl_FragColor to the result: gl_FragColor = vec4(u_resolution.x / 0.0);

Console output:

gl.js:144
Error in program linking:
C:\fakepath(43,33-77): warning X4008: floating point division by zero
C:\fakepath(45,34-64): warning X4008: floating point division by zero
C:\fakepath(46,22-52): warning X4008: floating point division by zero
C:\fakepath(46,22-52): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with default flags. (ps_3_0)
 Retrying with avoid flow control
C:\fakepath(43,33-77): warning X4008: floating point division by zero
C:\fakepath(45,34-64): warning X4008: floating point division by zero
C:\fakepath(46,22-52): warning X4008: floating point division by zero
C:\fakepath(46,22-52): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with avoid flow control flags. (ps_3_0)
 Retrying with prefer flow control
C:\fakepath(43,33-77): warning X4008: floating point division by zero
C:\fakepath(45,34-64): warning X4008: floating point division by zero
C:\fakepath(46,22-52): warning X4008: floating point division by zero
C:\fakepath(46,22-52): error X4579: NaN and infinity literals not allowed by shader model

Warning: D3D shader compilation failed with prefer flow control flags. (ps_3_0)

Failed to create D3D shaders.

GlslCanvas.js:385
Uncaught TypeError: Failed to execute 'getUniformLocation' on 'WebGLRenderingContext': parameter 1 is not of type 'WebGLProgram'.
    at GlslCanvas.uniform (GlslCanvas.js:385)
    at GlslCanvas.render (GlslCanvas.js:458)
    at RenderLoop (GlslCanvas.js:156)

Surprisingly, gl_FragColor = vec4(500.0 / 0.0); doesn't cause the error.

P.S. editor.thebookofshaders.com is dead

@patriciogonzalezvivo
Copy link
Owner

Seams like a WebGL issue. http://editor.thebookofshaders.com is probably trying to reload the previous code you where working on, the one that have the error. Try cleaning your cache and cookies.

@demicuz
Copy link
Author

demicuz commented Dec 10, 2017

Would you ever fix this issue? It also affects shaders on The Book of Shaders, which is kind of annoying. If you mistype something, you often don't even know it, unless you hold the console open all the time. The shader just freezes.

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

2 participants