Basic alpha blending works but I have no z ordering yet.

This commit is contained in:
Zed A. Shaw 2026-08-29 16:08:33 -04:00
parent 128f522089
commit 11b7f4a3ed
14 changed files with 272 additions and 30 deletions

View file

@ -66,24 +66,33 @@ void process_input(GLFWwindow *window, Scene& scene) {
}
if(glfwGetKey(window, GLFW_KEY_M) == GLFW_PRESS) {
scene.spawn("marble_cube", scene.camera.position);
components::Rotation rotation{90.0f, {1.0f, 0.0f, 0.0f}};
scene.spawn("grass", scene.camera.position, rotation);
}
if(glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS) {
for(auto& light : scene.light.directional) {
light.adjust(-0.01f);
}
scene.shader.apply_lighting(scene.light);
}
if(glfwGetKey(window, GLFW_KEY_P) == GLFW_PRESS) {
for(auto& light : scene.light.directional) {
light.adjust(0.01f);
}
scene.shader.apply_lighting(scene.light);
}
}
Scene setup() {
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LESS);
components::Scene config = utils::load_scene_config("config.json");