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

Rendering the shadow maps

We now have everything we need in order to start rendering shadow maps of our scene. Some rather significant changes are going to have to be made to the LightManager class in order to support this functionality, not to mention properly store and use these shadow map textures during later passes. Let's see what changes we need to make in order to make this happen.

Modifying the light manager

First, let's make some adjustments to the light manager class definition. We're going to need a couple of methods to add shadow caster prototypes, add actual shadow casting objects, and render the shadow maps:

class LightManager { public: ... const std::string& AddCasterPrototype(const std::string& l_name, std::unique_ptr<ShadowCasterPrototype> ...

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