Computer Graphics Programming in OpenGL with C++ by V. Scott Gordon

Computer Graphics Programming in OpenGL with C++ by V. Scott Gordon

Author:V. Scott Gordon [V. Scott Gordon & John Clevenger]
Language: eng
Format: epub
Publisher: Mercury Learning & Information
Published: 2018-02-26T16:00:00+00:00


(Program 7.1, continued)

The output of Program 7.1 is shown in Figure 7.9.

The vertex shader contains our first example of using the struct notation. A GLSL “struct” is like a datatype; it has a name and a set of fields. When a variable is declared using the name of a struct, it then contains those fields, which are accessed using the “.” notation. For example, variable “light” is declared of type “PositionalLight”, so we can thereafter refer to its fields light.ambient, light.diffuse, and so forth.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Categories