How does one receive the current time, width and height values into a composition when one has selected "new shader", then "image generator"?

When I write:

uniform float width, height; void main() { vec2 uv=gl_FragCoord.xy/vec2(width,height); gl_FragColor = vec4(uv.x,uv.y,.5,1); }

...then run the composition, it appears that the shader does not receive the current window width and height values from the VUO editor app.

Comments

I am now noticing that there

George_Toledo's picture
Submitted by

I am now noticing that there is no way to use this shader mode to make a shader that can be attached to a 3D scene. That might be worth considering. It's a nice editor setup...

I think that since a fragment shader shares variables with the vertex shader, that it would be much better case to be able to access it...and write vertex and/or geometry shaders as well, to export to use in other vuo compositions. Being able to run the editor part within the normal vuo graph would be excellent.

In light of all of these things being a bit time consuming to implement, I will just add that it may be worth considering adding the vertex shader code above the 1.20 quick reference on the right hand side of the editor, so it can be viewed when writing the fragment shaders.

Pages