knowing the glsl version of your gpu glgetstring (gl_shading_language_version)

8
Knowing the GLSL version of your GPU glGetString(GL_SHADING_LANGUAGE_VER SION) GLSL 1.20 or later?

Upload: julian-snow

Post on 30-Dec-2015

40 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Knowing the  GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)

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)

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)

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)

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)

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)

Flat shading in OpenGL 3.0?

Page 7: Knowing the  GLSL version of your GPU glGetString (GL_SHADING_LANGUAGE_VERSION)

Strongly recommend to implement some transformations!

The difference between the shaders can be easily shown