diff --git a/33-shadow-mapping/src/main.cpp b/33-shadow-mapping/src/main.cpp index eae7f13..77dec1b 100644 --- a/33-shadow-mapping/src/main.cpp +++ b/33-shadow-mapping/src/main.cpp @@ -135,7 +135,7 @@ void update(GLFWwindow* window, std::shared_ptr scene) { void render(GLFWwindow* window, std::shared_ptr scene, Text &text) { scene->render(window); - // text.render(text_content, 25.0f, 25.0f, 1.0f, glm::vec3(1.0, 0.0f, 0.0f)); + text.render(text_content, 25.0f, 25.0f, 1.0f, glm::vec3(1.0, 0.0f, 0.0f)); glfwSwapBuffers(window); } diff --git a/33-shadow-mapping/src/scene.cpp b/33-shadow-mapping/src/scene.cpp index febcf10..be842ba 100644 --- a/33-shadow-mapping/src/scene.cpp +++ b/33-shadow-mapping/src/scene.cpp @@ -53,7 +53,6 @@ void Scene::render_scene(GLFWwindow* window, Shader& with_shader) { } void Scene::render_shadows(GLFWwindow* window) { - glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT); glClearColor(0.1f, 0.1f, 0.1f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -194,6 +193,9 @@ void Scene::spawn(const std::string& name) { camera.position, rot, 1.0f); + + // rebuild the shadows + shadows_rendered = false; } else { dbc::log($F("No model named: {}", name)); }