Shadows working but look dumb. The issue so far was that framebuffer.cpp interferes with the framebuffer used to create the shadow map.
This commit is contained in:
parent
a29494325b
commit
482ec07fb3
19 changed files with 261 additions and 206 deletions
|
|
@ -4,8 +4,10 @@
|
|||
#include "utils.hpp"
|
||||
#include <print>
|
||||
#include <format>
|
||||
#include "text.hpp"
|
||||
|
||||
void framebuffer_size_callback(GLFWwindow *window, int width, int height);
|
||||
|
||||
std::string text_content{""};
|
||||
|
||||
void init_glfw() {
|
||||
|
|
@ -77,6 +79,10 @@ void process_input(GLFWwindow *window, Scene& scene) {
|
|||
scene.reflect_on = !scene.reflect_on;
|
||||
}
|
||||
|
||||
if(glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS) {
|
||||
scene.debug_on = !scene.debug_on;
|
||||
}
|
||||
|
||||
if(glfwGetKey(window, GLFW_KEY_H) == GLFW_PRESS) {
|
||||
scene.spawn("human");
|
||||
glm::vec3 pos = scene.camera.position;
|
||||
|
|
@ -127,10 +133,9 @@ void update(GLFWwindow* window, Scene& scene) {
|
|||
scene.update();
|
||||
}
|
||||
|
||||
void render(GLFWwindow* window, Scene& scene, Text& text) {
|
||||
void render(GLFWwindow* window, Scene& scene, Text &text) {
|
||||
scene.render(window);
|
||||
text.render(text_content, 25.0f, 25.0f, 1.0f, glm::vec3(1.0, 0.0f, 0.0f));
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue