vec4
Vec4 — four floats, ready to be a shader uniform
- vec3
vec4 is the simplest node in the GLSL Nodes pack and it does exactly what it says: it gives you four floats - x, y, z, w - and outputs them as a VEC4 that your shader can consume as a uniform. No widgets, no tricks, no network calls. If you need to pass a 4-component value into a glslUniforms node, this is the boring, dependable way to do it.
It's worth being clear about the "boring" part, because this node lives in the same pack as much flashier things. The vec4's siblings cover the visual cases - vec2 (pos) and vec3 (pos) for spatial points, vec4 (color) for colors - and this one exists for everything else. A clip plane, a padding amount, a four-channel coefficient, a raw RGBA where you want to type the numbers. When the value has no natural visual form, four plain floats are the honest tool.
Inputs and output
Four required inputs, one per component:
- x, y, z, w - each a
FLOATwith a default of 0, a huge allowed range, and a 0.001 step. Set them like you'd set any ComfyUI float.
The output is VEC4 (its name in the node's return table is literally "vec3", a leftover naming slip in the pack source - don't let that confuse you when you're reading the graph; the type is what matters). It wires into glslUniforms as a u_val* input, which is how the value becomes a uniform vec4 your shader reads. Under the hood the node just returns the tuple (x, y, z, w) - there's no conversion or normalization, so what you type is exactly what the shader gets.
When to reach for it, and when not to
Reach for it when you want a raw four-component number. Don't reach for it when the value is a color - vec4 (color) gives you a picker and the same output type. Don't reach for it when it's a position in space - vec3 (pos) handles that more naturally (though its z has a known bug, so for anything where z matters, four explicit floats or the plain vec3 node are the safe bet).
Install
ComfyUI Manager → search "GLSL Nodes", or cd ComfyUI/custom_nodes && git clone https://github.com/patriciogonzalezvivo/comfyui_glslnodes, then restart. Same as every node in this pack: moderngl, numpy, and snowy get pulled in on first boot. There's nothing fragile about this node - it's a tuple of four floats, and it's hard to break.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| x | FLOAT | 0.000-18446744073709550000–18446744073709550000 | — |
| y | FLOAT | 0.000-18446744073709550000–18446744073709550000 | — |
| z | FLOAT | 0.000-18446744073709550000–18446744073709550000 | — |
| w | FLOAT | 0.000-18446744073709550000–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vec3 | VEC4 | — |