Difference between revisions of "vec4"

(Created page with "A vector with 4 floating-point number components. These can be accessed with <code>.r/g/b/a</code>, <code>.x/y/z/w</code>, or <code>[0/1/2/3]</code>. <source lang="glsl> vec4...")
 
m (Added a missing quote)
Line 1: Line 1:
 
A vector with 4 floating-point number components. These can be accessed with <code>.r/g/b/a</code>, <code>.x/y/z/w</code>, or <code>[0/1/2/3]</code>.
 
A vector with 4 floating-point number components. These can be accessed with <code>.r/g/b/a</code>, <code>.x/y/z/w</code>, or <code>[0/1/2/3]</code>.
<source lang="glsl>
+
<source lang="glsl">
 
vec4 example = vec4(0.333, 0.666, 0.999, 1.0);
 
vec4 example = vec4(0.333, 0.666, 0.999, 1.0);
  

Revision as of 03:34, 29 June 2022

A vector with 4 floating-point number components. These can be accessed with .r/g/b/a, .x/y/z/w, or [0/1/2/3].

vec4 example = vec4(0.333, 0.666, 0.999, 1.0);

float r = example.r;
float g = example.g;
float b = example.b;
float a = example.a;

Read more:

See Also

Other Languages