fragCoord is broken
aaronzshey opened this issue · 2 comments
aaronzshey commented
I used the following code block:
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
void main() {
vec2 st = gl_FragCoord.xy/u_resolution;
gl_FragColor = vec4(st.x,st.y,0.0,1.0);
}
Using the Book of Shaders editor, it looks like this:
But when I use the glsl sandbox, I get to see a beautiful blaring yellow:
https://glslsandbox.com/e#81113.0
I don't see any errors in the console. I'm using Opera browser Version:85.0.4341.60, and this is my system info:
Operating System: Ubuntu 21.10
Kernel: Linux 5.13.0-40-generic
Architecture: x86-64
Hardware Model: MacBookPro11,4
aaronzshey commented
So I figured out the problem - the correct variable is uniform vec2 resolution
, not u_resolution
. Why isn't u_resolution supported?
aaronzshey commented
https://twitter.com/mrdoob/status/1524897052005748737?s=20&t=6ztwYcV5lFLEM-LpKsh0dg
Straight from the mouth of god himself!