Getting ready

Start with an OpenGL application that provides the vertex position in attribute location 0, and the vertex normal in attribute location 1 (refer to the Sending data to a shader using vertex attributes and vertex buffer objects recipe in Chapter 2, Working with GLSL Programs). The OpenGL application should also provide the standard transformation matrices (projection, modelview, and normal) via uniform variables.

The light position (in camera coordinates), Kd, and Ld should also be provided by the OpenGL application via uniform variables. Note that Kd and Ld are of type vec3. We can use vec3 to store an RGB color as well as a vector or point.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.45.92