If “TIME” is capitalized and it is working, it is not the same “time” variable that corresponds with the protocol input port for time, it appears to be a value that the shader can receive via standard uniforms, without receiving any data via ports.
What I am trying to understand is, when a shader is created this way, there are these time, width and height ports existing as part of the protocol. How do I get these exact port values into the shader to work with?
The time port, the TIME variable along with width and height are in a way just arbitrary input ports. If you save your shader to the library, they will work as regular input ports for their type, and they won't act on anything unless they get some sort of data/event. However, when you edit/run the shader in the shader editor, these values will be provided to you through those ports. If you run the code I first posted, and change the width/height of the rendering window the green amount will be decided by that relationship. In short, I think they are pre-defined uniforms that are reserved for the editor so that it can take over those for easier programming :)
Yes - to both the questions I think actually. If I have understood it correctly, a fragment shader always needs a vertex shader to display anything (at least in Vuo). My guess is that the vertex shader is just a very basic quad and some default uniforms that sets up a framework for less boilerplate coding.
At the risk of confusing you further, if you look at the code for a custom GLSL image filter node in the Vuo source (that is the C source, has nothing to do with the shader editor), you can find the following line setting up the shader:
Oh, I see it working by running it in the shader editor (like a composition). Time and resolution are supported without declaring any uniforms. If you use the Image filter protocol/editor there is also provided an image of a bird when you run it standalone.
The code above is the only thing you need to input for a simple shader utilizing time, resolution and inputs. It will modulate the red channel by time, the green channel by the rendered window size, and the blue channel by a published port/slider.