summaryrefslogtreecommitdiff
path: root/c2.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-02-22 17:01:35 +1100
committerquou <quou@disroot.org>2025-02-22 17:01:53 +1100
commit04db6b0ccd81d988cfe3a1d09e4eb00eeea77273 (patch)
tree5163857dca5070ecea802452c1e4e22806e4fbab /c2.cpp
parent944ca7aede48f358329cc9e6cdac479648f30c17 (diff)
basic shadows
Diffstat (limited to 'c2.cpp')
-rw-r--r--c2.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/c2.cpp b/c2.cpp
index d5b262a..761d9de 100644
--- a/c2.cpp
+++ b/c2.cpp
@@ -754,7 +754,7 @@ struct C2 : public App {
auto sun = world->create_entity();
auto [light] = world->add<Sun_Light>(sun);
light.colour = v3f(1.0f, 0.95f, 0.80f);
- light.dir = v3f(0.57f, 0.57f, 0.57f);
+ light.dir = v3f(-0.57f, 0.57f, 0.57f);
light.brightness = 1.0f;
light.caster = true;
}
@@ -889,15 +889,15 @@ struct C2 : public App {
renderer.env_cubemap = eprobe.get_cubemap();
renderer.clamped_linear = clamped_linear;
- renderer.drawlists[FORWARD].camera = camera;
- renderer.drawlists[SHADOW_MAP_START].camera = camera;
+ renderer.setcam(FORWARD, camera);
Texture& bb = dev->get_texture(hdr_target);
pcam.asp = (float)bb.w / (float)bb.h;
orbit_cam.update_orbit(*this);
pcam.update();
- lighting.update(dev, ctx, *world);
+ lighting.update(dev, ctx, *world, renderer, scene);
update_scene(scene, dev, lighting, pcam, *world);
+ lr.add_box(scene.bound);
ctx.debug_push("scene");
renderer.render(
dev,
@@ -1004,7 +1004,7 @@ struct C2 : public App {
quad.destroy(dev);
scene.destroy(dev);
sky.destroy(dev);
- lighting.destroy(dev);
+ lighting.destroy(dev, renderer);
lr.destroy(dev);
eprobe.destroy(dev);
tonemap.destroy(dev);