Merge pull request #315 from acolle/master

Fixed wrong variable names in /appendix/04/
This commit is contained in:
Patricio Gonzalez Vivo 2020-08-30 12:18:11 -07:00 committed by GitHub
commit a0591e5670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ); vec4 color = vec4( 0.2, 0.8, 0.0, 1.0 );
//and retrieve the color components in the A,B,G,R order //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: And of course, you can ask the same component multiple times:
```glsl ```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 ); 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 //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. This is extremely handy to combine parts of vectors together, extract only the rgb channels of a RGBA color etc.