From 04db6b0ccd81d988cfe3a1d09e4eb00eeea77273 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 22 Feb 2025 17:01:35 +1100 Subject: basic shadows --- c2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'c2.cpp') 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.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); -- cgit v1.2.3-54-g00ecf