feat(lambda-rs): Update pipelines to disable blending by default#183
Merged
feat(lambda-rs): Update pipelines to disable blending by default#183
Conversation
✅ Coverage Report📊 View Full HTML Report (download artifact) Overall Coverage
Changed Files in This PR
PR Files Coverage: 87.52% (891/1018 lines) Generated by cargo-llvm-cov · Latest main coverage Last updated: 2026-02-12 00:20:52 UTC · Commit: |
There was a problem hiding this comment.
Pull request overview
This PR changes the default render pipeline behavior to be opaque (no blending) for better performance, and adds an explicit opt-in blending API so transparency is enabled only when needed.
Changes:
- Introduces
BlendMode+with_blend(...)on both engine-level and platform-levelRenderPipelineBuilder, defaulting toNone(opaque/replace). - Threads the blend configuration through the engine builder into the platform wgpu pipeline creation (replacing the prior hardcoded
ALPHA_BLENDING). - Updates the reflective-room demo/tutorial and rendering docs to explicitly enable alpha blending where translucency is intended, and adds unit tests in the platform layer.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/tutorials/rendering/techniques/reflective-room.md | Updates tutorial code to explicitly opt into alpha blending for the translucent floor pass. |
| docs/rendering.md | Documents the new default (opaque) and shows how to opt into blending. |
| demos/render/src/bin/reflective_room.rs | Updates demo pipeline setup to explicitly enable alpha blending for the floor visual pass. |
| crates/lambda-rs/src/render/pipeline.rs | Adds engine-level BlendMode and threads it into the platform pipeline builder via with_blend. |
| crates/lambda-rs-platform/src/wgpu/pipeline.rs | Adds platform-level BlendMode (including Custom) and uses it to set ColorTargetState.blend, plus adds unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pipelines previously hardcoded
ALPHA_BLENDINGfor all color targets, adding unnecessary blending overhead for the common case (fully opaque geometry). This PR changes the default to no blending (opaque/replace) and adds an explicit opt-in API for transparency.Related Issues
Changes
RenderPipelineBuildercolor target blending toNone(replace/opaque) instead of always enablingALPHA_BLENDING.BlendModeenum +RenderPipelineBuilder::with_blend(BlendMode)to opt into:None(default)AlphaBlendingPremultipliedAlphaAdditiveCustom(wgpu::BlendState)(platform-level advanced use)wgpu.Noneand that presets map to the expectedwgpublend states.Type of Change
Affected Crates
lambda-rslambda-rs-platformlambda-rs-argslambda-rs-loggingdemos,docsChecklist
cargo +nightly fmt --all)cargo clippy --workspace --all-targets -- -D warnings)cargo test --workspace)Testing
Commands run:
Manual verification steps (if applicable):
demos/renderreflective-room and confirm the floor tint remains translucent by enabling.with_blend(BlendMode::AlphaBlending).Screenshots/Recordings
N/A
Platform Testing
Additional Notes
Migration: any pipeline that relied on implicit alpha blending must now opt in:
This improves default performance for opaque geometry, especially on tile-based GPUs where blending can increase bandwidth/cost.