13.07.2015 Views

Rendering, OpenGL, and Lighting - Caltech

Rendering, OpenGL, and Lighting - Caltech

Rendering, OpenGL, and Lighting - Caltech

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using shaders• Example included in lab 1– Can use that code in future projects• p = glCreateProgram();• v = glCreateShader(GL_VERTEX_SHADER);• glShaderSource(v, 1, &src, NULL);• glAttachProgram(p, v);• glAttachProgram(p, f);• glLinkProgram(p);• glUseProgram(p);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!