Skip to content

Commit

Permalink
fix shadow map
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Feb 25, 2023
1 parent e3cdf9b commit a9e00af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geom/src/perp_camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Camera {

let base = self.pos;

let view = look_at_rh(base + dir, -dir, self.up);
let view = look_to_rh(base + dir, -dir, self.up);
let proj: Matrix4 = Ortho {
left: -d,
right: d,
Expand Down
6 changes: 5 additions & 1 deletion wgpu_engine_demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ async fn run(el: EventLoop<()>, window: Window) {
)
.await;

gfx.render_params.value_mut().shadow_mapping_enabled = 2048;
gfx.sun_shadowmap = GfxContext::mk_shadowmap(&gfx.device, 2048);
gfx.update_simplelit_bg();

let mut state = State::new(&mut gfx);

let mut frame: Option<_> = None;
Expand Down Expand Up @@ -199,7 +203,7 @@ async fn run(el: EventLoop<()>, window: Window) {
params.ssao_falloff = inline_tweak::tweak!(0.00008);
params.ssao_base = inline_tweak::tweak!(0.01);
params.ssao_samples = inline_tweak::tweak!(8);
params.shadow_mapping_enabled = 1;
params.shadow_mapping_enabled = 2048;

let (mut enc, view) = gfx.start_frame(&sco);
gfx.render_objs(&mut enc, &view, |fc| state.render(fc));
Expand Down

0 comments on commit a9e00af

Please sign in to comment.