O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a Vertex Shader

Before you write your first vertex shader program, you need something to render other than the blank screen that currently is displayed after you click one of the new game type buttons. Your first object rendered with the programmable pipeline might as well be the go-kart because that will be the focus of the game. Add the following variables to your class now:

// Kart mesh
private Mesh kartMesh = null;
private Texture[] kartTextures = null;

You've been using meshes and textures throughout this book, so this code shouldn't be that surprising. You might have noticed that the materials you normally create when you load the mesh are nonexistent, though. The materials are used by the fixed-function pipeline to determine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required