knowing the glsl version of your gpu glgetstring (gl_shading_language_version)
DESCRIPTION
Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION). GLSL 1.20 or later?. GLSL 1.3 or Later . Great Tutorial for OpenGL 3.0 or later: http:// www.opengl-tutorial.org. GLFW keyboard call back. glfwSetCharCallback ( My_Key_Callback );. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/1.jpg)
Knowing the GLSL version of your GPU
glGetString(GL_SHADING_LANGUAGE_VERSION)
GLSL 1.20 or later?
![Page 2: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/2.jpg)
Great Tutorial for OpenGL 3.0 or later:
http://www.opengl-tutorial.org
GLSL 1.3 or Later
![Page 3: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/3.jpg)
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);
![Page 4: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/4.jpg)
Skeleton Code provide on ICG course web
GLSL 1.2 or older
Tutorial for GLSL 1.2http://www.lighthouse3d.com/tutorials/glsl-tutorial/
![Page 5: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/5.jpg)
HW2 requirementVersion OpenGL 3.0 + GLSL 1.3 OpenGL 2.0 + 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.
![Page 6: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/6.jpg)
Flat shading in OpenGL 3.0?
![Page 7: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/7.jpg)
Strongly recommend to implement some transformations!
The difference between the shaders can be easily shown
![Page 8: Knowing the GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)](https://reader036.vdocuments.us/reader036/viewer/2022082422/56812bce550346895d902b1c/html5/thumbnails/8.jpg)
GLSL quick reference guidehttp://www.opengl.org/documentation/glsl/