examples: apply real texture assets to multi-mesh examples
- meshes/cube: procedural checkerboard -> uv_texture.jpg (8x8 UV grid) - meshes/pbr: floor -> ground.jpeg, bump cube -> cave.jpg + caveNormal.jpg (normal map pre-encoded via sRGB OETF to cancel the GPU sRGB decode) - lights/shadow: ground -> ground.jpeg, cube -> uv_texture.jpg - effects/demo: ground -> ground.jpeg, cube -> uv_texture.jpg - effects/fog: ground -> ground.jpeg (tiled 80x80), cubes -> stonewall.jpg - effects/dof: ground -> ground.jpeg, cubes -> uv_texture.jpg - cameras/culling: shared cube mesh -> uv_texture.jpg - add lib/examples/assets/textures/ (19 assets, 6.5 MB) - document assets + usage in examples READMEs, docs/user/examples.md, docs/user/meshes/materials.md (CARGO_MANIFEST_DIR pattern, sRGB caveat)
This commit is contained in:
@@ -4,7 +4,7 @@ Examples where the **camera** drives what gets rendered.
|
||||
|
||||
| Example | Run command | What it shows |
|
||||
|---------|-------------|---------------|
|
||||
| `culling` | `cargo run -p wsg-lib --example culling` | GPU-driven frustum culling: a 15×15 grid of cubes, off-frustum objects skipped |
|
||||
| `culling` | `cargo run -p wsg-lib --example culling` | GPU-driven frustum culling: a 15×15 grid of UV-atlas cubes, off-frustum objects skipped |
|
||||
|
||||
> All commands run from the repo root.
|
||||
|
||||
@@ -16,9 +16,11 @@ objects changes — with **zero CPU cost** (the GPU decides in a compute pass).
|
||||
|
||||
## `culling` — GPU Frustum Culling
|
||||
|
||||
A grid of **15×15 = 225 cubes** is placed on a large floor. The GPU-driven
|
||||
culling (compute shader) determines which cubes are visible in the camera
|
||||
frustum and zeros their indirect draw args — **zero CPU cost**.
|
||||
A grid of **15×15 = 225 cubes** is placed on a large floor. The shared cube
|
||||
mesh is textured with the `uv_texture.jpg` atlas — the colourful labelled
|
||||
cells make it obvious exactly which cubes the GPU draws and which it culls.
|
||||
The GPU-driven culling (compute shader) determines which cubes are visible in
|
||||
the camera frustum and zeros their indirect draw args — **zero CPU cost**.
|
||||
|
||||
```sh
|
||||
cargo run -p wsg-lib --example culling
|
||||
|
||||
Reference in New Issue
Block a user