Skip to content

Commit

Permalink
chore: initial shadow mapping with shadow maps hosted in an atlas (#157)
Browse files Browse the repository at this point in the history
* lighting bindgroup

* initial shadow mapping API in place

* pin cargo gpu

* lots of bug fixes in the shadow mapping path

* more debugging shadow mapping

* can programmatically capture gpu traces, ugly shadows are working

* added configurable bias to shadow mapping

* shadow mapping culls front face to cut down peter panning

* 1 Cargo Files:
   • Cargo.lock and Cargo.toml have been updated to change the version of the
     craballoc dependency from 0.1.3 to 0.1.5.
2 Example Crate:
   • crates/example/src/lib.rs has been modified to update the lighting and shadow
     mapping logic, including changes to how shadow maps are created and used.
3 Shaders:
   • Several shader files (.spv and .wgsl) have binary differences, indicating
     updates to the compiled shader code.
4 Renderling Crate:
   • Multiple files in the crates/renderling/src directory have been updated,
     including atlas.rs, atlas/atlas_image.rs, atlas/cpu.rs, context.rs,
     draw/cpu.rs, lib.rs, light.rs, light/cpu.rs, math.rs, pbr.rs, stage.rs, and
     stage/cpu.rs.
   • These changes involve updates to the atlas and texture handling, lighting and
     shadow mapping improvements, and modifications to the rendering pipeline.
5 GLTF File:
   • The gltf/shadow_mapping_sanity_spot.blend file has binary changes, suggesting
     updates to the 3D model or scene configuration.

Overall, the changes focus on improving the rendering and lighting systems,
particularly around shadow mapping and texture management.

* feat: Add shadow map view management for directional and point lights

* feat: Implement `ShadowMapViews::new_six` for point light shadow maps

* moved shadow maps to a shadow map atlas, included atlas blitting

* WIP moving all lighting to the lighting slab w/ AnalayticalLightBundle

* functional shadows read out of the shadow map atlas
  • Loading branch information
schell authored Feb 9, 2025
1 parent c0fca3e commit c339e97
Show file tree
Hide file tree
Showing 97 changed files with 7,092 additions and 4,861 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[alias]
xtask = "run --package xtask --"
shaders = "xtask compile-shaders"
linkage = "xtask generati-linkage"
linkage = "xtask generate-linkage"

[build]
rustflags = ["--cfg=web_sys_unstable_apis"]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ jobs:
- uses: moonrepo/setup-rust@v1
- run: rustup default stable
- run: rustup update
- run: cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu
- run: |
cargo install \
--git https://github.com/rust-gpu/cargo-gpu \
--rev 91b50948c5e036927b0fccc08b6fd26d0168b92b \
cargo-gpu
- run: cargo gpu show commitsh
- id: cachepathstep
run: |
Expand Down
117 changes: 79 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async-channel = "1.8"
bytemuck = { version = "1.13.0", features = ["derive"] }
cfg_aliases = "0.2"
clap = { version = "4.5.23", features = ["derive"] }
craballoc = { version = "0.1.3" }
craballoc = { version = "0.1.9" }
crabslab = { version = "0.6.3", default-features = false }
ctor = "0.2.2"
dagga = "0.2.1"
Expand All @@ -47,8 +47,9 @@ wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = "0.3"
winit = { version = "0.30" }
wgpu = { version = "23.0" }

wgpu = { version = "24.0" }
wgpu-core = { version = "24.0" }
metal = "0.31"

[profile.dev]
opt-level = 1
Expand Down
Loading

0 comments on commit c339e97

Please sign in to comment.