Skip to content

Commit 7f4307b

Browse files
committed
[update] tutorials to include conclusions.
1 parent 70bfaff commit 7f4307b

File tree

3 files changed

+43
-8
lines changed

3 files changed

+43
-8
lines changed

docs/tutorials/textured-cube.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Textured Cube: 3D Push Constants + 2D Sampling"
33
document_id: "textured-cube-tutorial-2025-11-10"
44
status: "draft"
55
created: "2025-11-10T00:00:00Z"
6-
last_updated: "2025-11-10T00:00:00Z"
7-
version: "0.1.0"
6+
last_updated: "2025-11-10T03:00:00Z"
7+
version: "0.1.1"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "727dbe9b7706e273c525a6ca92426a1aba61cdb6"
12+
repo_commit: "fe79756541e33270eca76638400bb64c6ec9f732"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["tutorial", "graphics", "3d", "push-constants", "textures", "samplers", "rust", "wgpu"]
@@ -39,6 +39,7 @@ Reference implementation: `crates/lambda-rs/examples/textured_cube.rs`.
3939
- [Step 10 — Handle Window Resize](#step-10)
4040
- [Validation](#validation)
4141
- [Notes](#notes)
42+
- [Conclusion](#conclusion)
4243
- [Putting It Together](#putting-it-together)
4344
- [Exercises](#exercises)
4445
- [Changelog](#changelog)
@@ -489,6 +490,15 @@ fn on_event(&mut self, event: Events) -> Result<ComponentResult, String> {
489490
- Winding and culling: keep face winding CCW to work with `CullingMode::Back`. Toggle to `CullingMode::None` when debugging geometry.
490491
- Indices: the cube uses non‑indexed vertices for clarity. An index buffer SHOULD be used for efficiency in production code.
491492

493+
## Conclusion <a name="conclusion"></a>
494+
This tutorial delivered a rotating, textured cube with depth testing and
495+
back‑face culling. It compiled shaders that use a vertex push‑constant block
496+
for model‑view‑projection and model matrices, built a cube mesh and vertex
497+
layout, created an sRGB texture and sampler, and constructed a pipeline with
498+
depth and culling. Per‑frame transforms were computed and uploaded via push
499+
constants, and draw commands were recorded. The result demonstrates push
500+
constants for per‑draw transforms alongside 2D sampling in a 3D render path.
501+
492502
## Putting It Together <a name="putting-it-together"></a>
493503
- Full reference: `crates/lambda-rs/examples/textured_cube.rs`
494504
- The example includes logging in `on_attach` and uses the same builders and commands shown here.
@@ -510,4 +520,5 @@ fn on_event(&mut self, event: Events) -> Result<ComponentResult, String> {
510520
- Bind two textures and blend per face based on projected UVs.
511521

512522
## Changelog <a name="changelog"></a>
523+
- 0.1.1 (2025-11-10): Add Conclusion section summarizing outcomes; update metadata and commit.
513524
- 0.1.0 (2025-11-10): Initial draft aligned with `crates/lambda-rs/examples/textured_cube.rs` including push constants, depth, culling, and projected UV sampling.

docs/tutorials/textured-quad.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Textured Quad: Sample a 2D Texture"
33
document_id: "textured-quad-tutorial-2025-11-01"
44
status: "draft"
55
created: "2025-11-01T00:00:00Z"
6-
last_updated: "2025-11-10T02:00:00Z"
7-
version: "0.3.2"
6+
last_updated: "2025-11-10T03:00:00Z"
7+
version: "0.3.3"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "fc5eb52c74eb0835225959f941db8e991112b87d"
12+
repo_commit: "fe79756541e33270eca76638400bb64c6ec9f732"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["tutorial", "graphics", "textures", "samplers", "rust", "wgpu"]
@@ -38,6 +38,7 @@ Reference implementation: `crates/lambda-rs/examples/textured_quad.rs`.
3838
- [Step 9 — Handle Window Resize](#step-9)
3939
- [Validation](#validation)
4040
- [Notes](#notes)
41+
- [Conclusion](#conclusion)
4142
- [Putting It Together](#putting-it-together)
4243
- [Exercises](#exercises)
4344
- [Changelog](#changelog)
@@ -446,6 +447,14 @@ This event handler updates the stored window dimensions when a resize occurs. Th
446447
- Filtering and addressing: `linear_clamp` sets linear min/mag and clamp‑to‑edge. Pixel art MAY prefer `nearest_*`. Tiling textures SHOULD use `Repeat` address modes.
447448
- Pipeline layout: Include all used layouts via `.with_layouts(...)` when creating the pipeline; otherwise binding state is incomplete at draw time.
448449

450+
## Conclusion <a name="conclusion"></a>
451+
This tutorial implemented a complete 2D sampling path. It generated a
452+
checkerboard on the CPU, uploaded it as an sRGB texture, created a
453+
linear‑clamp sampler, and defined matching binding layouts. Shaders forwarded
454+
UV and sampled the texture; a mesh and render pipeline were built; commands
455+
were recorded using a centered viewport. The result renders a textured quad
456+
with correct color space handling and filtering.
457+
449458
## Putting It Together <a name="putting-it-together"></a>
450459
- Full reference: `crates/lambda-rs/examples/textured_quad.rs`
451460
- Minimal differences: the example includes empty `on_detach` and `on_update` hooks and a log line in `on_attach`.
@@ -465,6 +474,7 @@ This event handler updates the stored window dimensions when a resize occurs. Th
465474
- Discuss artifacts without mipmaps and how multiple levels would improve minification.
466475

467476
## Changelog <a name="changelog"></a>
477+
- 0.3.3 (2025-11-10): Add Conclusion section summarizing outcomes; update metadata and commit.
468478
- 0.3.2 (2025-11-10): Add narrative explanations after each code block; clarify lifecycle and binding flow.
469479
- 0.3.1 (2025-11-10): Align with example; add shader constants; attach resources; fix variable names; add missing section.
470480
- 0.3.0 (2025-11-01): Initial draft aligned with `crates/lambda-rs/examples/textured_quad.rs`.

docs/tutorials/uniform-buffers.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ document_id: "uniform-buffers-tutorial-2025-10-17"
44
status: "draft"
55
created: "2025-10-17T00:00:00Z"
66
last_updated: "2025-10-30T00:10:00Z"
7-
version: "0.4.0"
7+
last_updated: "2025-11-10T03:00:00Z"
8+
version: "0.4.1"
89
engine_workspace_version: "2023.1.30"
910
wgpu_version: "26.0.1"
1011
shader_backend_default: "naga"
1112
winit_version: "0.29.10"
12-
repo_commit: "88e99500def9a1c1a123c960ba46b5ba7bdc7bab"
13+
repo_commit: "fe79756541e33270eca76638400bb64c6ec9f732"
1314
owners: ["lambda-sh"]
1415
reviewers: ["engine", "rendering"]
1516
tags: ["tutorial", "graphics", "uniform-buffers", "rust", "wgpu"]
@@ -39,6 +40,7 @@ Reference implementation: `crates/lambda-rs/examples/uniform_buffer_triangle.rs`
3940
- [Step 10 — Handle Window Resize](#step-10)
4041
- [Validation](#validation)
4142
- [Notes](#notes)
43+
- [Conclusion](#conclusion)
4244
- [Exercises](#exercises)
4345
- [Changelog](#changelog)
4446

@@ -368,6 +370,15 @@ fn on_event(&mut self, event: Events) -> Result<ComponentResult, String> {
368370
- Update strategy: `CPU_VISIBLE` buffers SHOULD be used for per‑frame updates; device‑local memory MAY be preferred for static data.
369371
- Pipeline layout: All bind group layouts used by the pipeline MUST be included via `.with_layouts(...)`.
370372

373+
## Conclusion <a name="conclusion"></a>
374+
This tutorial produced a spinning triangle that reads a model‑view‑projection
375+
matrix from a uniform buffer. The implementation aligned the shader and Rust
376+
layouts, created shaders and a mesh, defined a bind group layout and uniform
377+
buffer, built a render pipeline, wrote per‑frame matrix updates from the CPU,
378+
and recorded draw commands with resize‑aware projection. The result establishes
379+
a minimal, reusable path for per‑frame data via uniform buffers that scales to
380+
multiple objects and passes.
381+
371382
## Exercises <a name="exercises"></a>
372383

373384
- Exercise 1: Time‑based fragment color
@@ -402,6 +413,9 @@ fn on_event(&mut self, event: Events) -> Result<ComponentResult, String> {
402413

403414
## Changelog <a name="changelog"></a>
404415

416+
- 0.4.1 (2025‑11‑10): Add Conclusion section summarizing accomplishments; update
417+
metadata and commit.
418+
405419
- 0.4.0 (2025‑10‑30): Added table of contents with links; converted sections to anchored headings; added ASCII data flow diagram; metadata updated.
406420
- 0.2.0 (2025‑10‑17): Added goals and book‑style step explanations; expanded
407421
rationale before code blocks; refined validation and notes.

0 commit comments

Comments
 (0)