CHAPTER 12

image

Setting the Scene with OpenGL

You’ve come quite far with OpenGL, having learned how to render and manipulate objects in a 3D scene. In this chapter, we will cover lighting in more detail and introduce you to other OpenGL features that will help you to add polish to your game.

Understanding Lighting

I introduced you to OpenGL’s lighting capabilities in Chapter 7, but glossed over some of the details. In this section, we will explore how to work with lights and use them to add greater realism to a 3D scene.

OpenGL uses the normals that you assign to the vertices or faces of a model to calculate the color of light that will be seen by ...

Get Beginning Python Games Development : With Pygame, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.