mirror of
https://github.com/patriciogonzalezvivo/thebookofshaders
synced 2024-11-11 13:10:57 +00:00
Merge pull request #315 from acolle/master
Fixed wrong variable names in /appendix/04/
This commit is contained in:
commit
a0591e5670
@ -240,7 +240,7 @@ So not only can you retrieve a subset of your data, but you can also specify the
|
||||
vec4 color = vec4( 0.2, 0.8, 0.0, 1.0 );
|
||||
|
||||
//and retrieve the color components in the A,B,G,R order
|
||||
vec4 backwards = v4.abgr; // backwards = vec4( 1.0, 0.0, 0.8, 0.2 );
|
||||
vec4 backwards = color.abgr; // backwards = vec4( 1.0, 0.0, 0.8, 0.2 );
|
||||
```
|
||||
And of course, you can ask the same component multiple times:
|
||||
```glsl
|
||||
@ -248,7 +248,7 @@ And of course, you can ask the same component multiple times:
|
||||
vec4 color = vec4( 0.2, 0.8, 0.0, 1.0 );
|
||||
|
||||
//and retrieve a GAG vec3 based on the G & A channels of the color
|
||||
vec3 GAG = v4.gag; // GAG = vec4( 0.8, 1.0, 0.8 );
|
||||
vec3 GAG = color.gag; // GAG = vec4( 0.8, 1.0, 0.8 );
|
||||
```
|
||||
|
||||
This is extremely handy to combine parts of vectors together, extract only the rgb channels of a RGBA color etc.
|
||||
|
Loading…
Reference in New Issue
Block a user