Knowing the GLSL version of your GPU glGetString(GL_SHADING_LANGUAGE_VERSION) GLSL 1.20 or later?
Great Tutorial for OpenGL 3.0 or later: GLSL 1.3 or Later
GLFW keyboard call back void My_Key_Callback(int character, int action) { if (action == GLFW_PRESS) { switch (character) { case '1': light_switch[0] = (light_switch[0]+1)%2; break; case 'f': shader_mode = 'f'; break; default: break; } glfwSetCharCallback(My_Key_Callback);
Skeleton Code provide on ICG course web GLSL 1.2 or older Tutorial for GLSL 1.2
HW2 requirement VersionOpenGL GLSL 1.3OpenGL GLSL 1.2 Rrequirement 1.Flat shader and Gouraud shader (+2pts) 2.Phong shader(+ 2pts) 3. Put "at least" three lights in the environment. They should be placed at the top- right-front, bottom-left-front and bottom-left-back sides of the object. (+1pt) 4. Any other efforts you make, including interface design, visual effects…etc. (bonus: +0-1 pt) 1.Flat shading and Gouraud shading by OpenGL function The rest are the same.
Flat shading in OpenGL 3.0?
Strongly recommend to implement some transformations! The difference between the shaders can be easily shown
GLSL quick reference guide