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> l_caster); ShadowCaster* AddShadowCaster(const std::string& l_prototypeName); ShadowCasterPrototype* GetPrototype(const std::string& l_name); ... private: ... void DrawShadowMap(GLuint l_shadowShader...