Constant
one colour everywhere
The simplest source there is: every texel takes the four channels below.
out
- Type name
graphics:Constant- Plane
graphics- Tags
imagegenerator- Language
wgsl- Tier
shader- Bundle
graphics- Source
node-bundles/graphics/Constant.wgsl- Availability
- available
Slots
| Slot | Direction | Type | |
|---|---|---|---|
out | output | TEXTURE |
Parameters
colour
| Name | Type | Default | Range | Doc |
|---|---|---|---|---|
r | float | 1 | 0 … 1 | |
g | float | 1 | 0 … 1 | |
b | float | 1 | 0 … 1 | |
a | float | 1 | 0 … 1 |
common
| Name | Type | Default | Range | Doc |
|---|---|---|---|---|
width | int | 0 | 0 … 8192 | Texture size in pixels; 0 follows the first wired texture input. A node that makes its own frames follows the patch's default instead. |
height | int | 0 | 0 … 8192 | Texture size in pixels; 0 follows the first wired texture input. A node that makes its own frames follows the patch's default instead. |
Source
The current source of this node, as it stands in the goofi repository at node-bundles/graphics/Constant.wgsl.
/* goofi
{ "doc": "one colour everywhere\nThe simplest source there is: every texel takes the four channels below.",
"tags": ["image", "generator"],
"params": [
{"group": "colour", "name": "r", "kind": "float", "default": 1.0, "min": 0.0, "max": 1.0},
{"group": "colour", "name": "g", "kind": "float", "default": 1.0, "min": 0.0, "max": 1.0},
{"group": "colour", "name": "b", "kind": "float", "default": 1.0, "min": 0.0, "max": 1.0},
{"group": "colour", "name": "a", "kind": "float", "default": 1.0, "min": 0.0, "max": 1.0} ] }
*/
fn shade(uv: vec2f) -> vec4f {
return vec4f(p.r, p.g, p.b, p.a);
}