mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
4bf647ff3b
# Objective - Alpha blending can easily fail in many situations and requires sorting on the cpu ## Solution - Implement order independent transparency (OIT) as an alternative to alpha blending - The implementation uses 2 passes - The first pass records all the fragments colors and position to a buffer that is the size of N layers * the render target resolution. - The second pass sorts the fragments, blends them and draws them to the screen. It also currently does manual depth testing because early-z fails in too many cases in the first pass. ## Testing - We've been using this implementation at foresight in production for many months now and we haven't had any issues related to OIT. --- ## Showcase ![image](https://github.com/user-attachments/assets/157f3e32-adaf-4782-b25b-c10313b9bc43) ![image](https://github.com/user-attachments/assets/bef23258-0c22-4b67-a0b8-48a9f571c44f) ## Future work - Add an example showing how to use OIT for a custom material - Next step would be to implement a per-pixel linked list to reduce memory use - I'd also like to investigate using a BinnedRenderPhase instead of a SortedRenderPhase. If it works, it would make the transparent pass significantly faster. --------- Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com> Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com> Co-authored-by: Charlotte McElwain <charlotte.c.mcelwain@gmail.com>
51 lines
1.7 KiB
TOML
51 lines
1.7 KiB
TOML
[package]
|
|
name = "bevy_core_pipeline"
|
|
version = "0.15.0-dev"
|
|
edition = "2021"
|
|
authors = [
|
|
"Bevy Contributors <bevyengine@gmail.com>",
|
|
"Carter Anderson <mcanders1@gmail.com>",
|
|
]
|
|
description = "Provides a core render pipeline for Bevy Engine."
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
dds = ["bevy_render/dds", "bevy_image/dds"]
|
|
trace = []
|
|
webgl = []
|
|
webgpu = []
|
|
tonemapping_luts = ["bevy_render/ktx2", "bevy_image/ktx2", "bevy_image/zstd"]
|
|
smaa_luts = ["bevy_render/ktx2", "bevy_image/ktx2", "bevy_image/zstd"]
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.15.0-dev" }
|
|
bevy_asset = { path = "../bevy_asset", version = "0.15.0-dev" }
|
|
bevy_core = { path = "../bevy_core", version = "0.15.0-dev" }
|
|
bevy_color = { path = "../bevy_color", version = "0.15.0-dev" }
|
|
bevy_derive = { path = "../bevy_derive", version = "0.15.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-dev" }
|
|
bevy_image = { path = "../bevy_image", version = "0.15.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-dev" }
|
|
bevy_render = { path = "../bevy_render", version = "0.15.0-dev" }
|
|
bevy_transform = { path = "../bevy_transform", version = "0.15.0-dev" }
|
|
bevy_math = { path = "../bevy_math", version = "0.15.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.15.0-dev" }
|
|
bevy_window = { path = "../bevy_window", version = "0.15.0-dev" }
|
|
|
|
serde = { version = "1", features = ["derive"] }
|
|
bitflags = "2.3"
|
|
radsort = "0.1"
|
|
nonmax = "0.5"
|
|
smallvec = "1"
|
|
thiserror = "1.0"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
|
|
all-features = true
|