O'Reilly logo

Mastering SFML Game Development by Raimondas Pupius

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

Using shaders

The standardization of the programmable pipeline now means shaders have to be written for certain tasks, including the basic ones. This means that simply submitting our vertex data and rendering it would do nothing, as the two fundamental chunks of the rendering pipeline, the vertex and fragment shaders, are non-existent. In this section, we are going to cover how shaders are loaded, built, and applied to our virtual geometry, in turn producing those glorious pixels on the screen.

Loading shader files

Before we can use shaders, we must first discuss how they are loaded. All we technically need to create a shader is a string, containing all of its code. A very simple helper function can be written to parse a file and return it as a ...

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