2020-04-06 03:19:02 +00:00
|
|
|
[package]
|
|
|
|
name = "bevy_render"
|
2022-04-17 23:04:52 +00:00
|
|
|
version = "0.8.0-dev"
|
2021-10-25 18:00:13 +00:00
|
|
|
edition = "2021"
|
2020-08-10 00:24:27 +00:00
|
|
|
description = "Provides rendering functionality for Bevy Engine"
|
|
|
|
homepage = "https://bevyengine.org"
|
|
|
|
repository = "https://github.com/bevyengine/bevy"
|
2021-07-23 21:11:51 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2020-08-10 00:24:27 +00:00
|
|
|
keywords = ["bevy"]
|
2020-04-06 03:19:02 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
[features]
|
|
|
|
png = ["image/png"]
|
|
|
|
hdr = ["image/hdr"]
|
|
|
|
tga = ["image/tga"]
|
|
|
|
jpeg = ["image/jpeg"]
|
|
|
|
bmp = ["image/bmp"]
|
2022-03-15 22:26:46 +00:00
|
|
|
dds = ["ddsfile"]
|
|
|
|
|
|
|
|
# For ktx2 supercompression
|
|
|
|
zlib = ["flate2"]
|
|
|
|
zstd = ["ruzstd"]
|
|
|
|
|
2022-07-04 09:14:04 +00:00
|
|
|
trace = ["profiling"]
|
2022-04-08 22:50:23 +00:00
|
|
|
tracing-tracy = []
|
2021-12-14 03:58:23 +00:00
|
|
|
wgpu_trace = ["wgpu/trace"]
|
|
|
|
ci_limits = []
|
2021-12-22 20:59:48 +00:00
|
|
|
webgl = ["wgpu/webgl"]
|
2021-12-14 03:58:23 +00:00
|
|
|
|
2020-04-06 03:19:02 +00:00
|
|
|
[dependencies]
|
|
|
|
# bevy
|
2022-04-17 23:04:52 +00:00
|
|
|
bevy_app = { path = "../bevy_app", version = "0.8.0-dev" }
|
|
|
|
bevy_asset = { path = "../bevy_asset", version = "0.8.0-dev" }
|
|
|
|
bevy_core = { path = "../bevy_core", version = "0.8.0-dev" }
|
|
|
|
bevy_derive = { path = "../bevy_derive", version = "0.8.0-dev" }
|
|
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev" }
|
Migrate to encase from crevice (#4339)
# Objective
- Unify buffer APIs
- Also see #4272
## Solution
- Replace vendored `crevice` with `encase`
---
## Changelog
Changed `StorageBuffer`
Added `DynamicStorageBuffer`
Replaced `UniformVec` with `UniformBuffer`
Replaced `DynamicUniformVec` with `DynamicUniformBuffer`
## Migration Guide
### `StorageBuffer`
removed `set_body()`, `values()`, `values_mut()`, `clear()`, `push()`, `append()`
added `set()`, `get()`, `get_mut()`
### `UniformVec` -> `UniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `len()`, `is_empty()`, `capacity()`, `push()`, `reserve()`, `clear()`, `values()`
added `set()`, `get()`
### `DynamicUniformVec` -> `DynamicUniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `capacity()`, `reserve()`
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-05-18 21:09:21 +00:00
|
|
|
bevy_encase_derive = { path = "../bevy_encase_derive", version = "0.8.0-dev" }
|
Visibilty Inheritance, universal ComputedVisibility and RenderLayers support (#5310)
# Objective
Fixes #4907. Fixes #838. Fixes #5089.
Supersedes #5146. Supersedes #2087. Supersedes #865. Supersedes #5114
Visibility is currently entirely local. Set a parent entity to be invisible, and the children are still visible. This makes it hard for users to hide entire hierarchies of entities.
Additionally, the semantics of `Visibility` vs `ComputedVisibility` are inconsistent across entity types. 3D meshes use `ComputedVisibility` as the "definitive" visibility component, with `Visibility` being just one data source. Sprites just use `Visibility`, which means they can't feed off of `ComputedVisibility` data, such as culling information, RenderLayers, and (added in this pr) visibility inheritance information.
## Solution
Splits `ComputedVisibilty::is_visible` into `ComputedVisibilty::is_visible_in_view` and `ComputedVisibilty::is_visible_in_hierarchy`. For each visible entity, `is_visible_in_hierarchy` is computed by propagating visibility down the hierarchy. The `ComputedVisibility::is_visible()` function combines these two booleans for the canonical "is this entity visible" function.
Additionally, all entities that have `Visibility` now also have `ComputedVisibility`. Sprites, Lights, and UI entities now use `ComputedVisibility` when appropriate.
This means that in addition to visibility inheritance, everything using Visibility now also supports RenderLayers. Notably, Sprites (and other 2d objects) now support `RenderLayers` and work properly across multiple views.
Also note that this does increase the amount of work done per sprite. Bevymark with 100,000 sprites on `main` runs in `0.017612` seconds and this runs in `0.01902`. That is certainly a gap, but I believe the api consistency and extra functionality this buys us is worth it. See [this thread](https://github.com/bevyengine/bevy/pull/5146#issuecomment-1182783452) for more info. Note that #5146 in combination with #5114 _are_ a viable alternative to this PR and _would_ perform better, but that comes at the cost of api inconsistencies and doing visibility calculations in the "wrong" place. The current visibility system does have potential for performance improvements. I would prefer to evolve that one system as a whole rather than doing custom hacks / different behaviors for each feature slice.
Here is a "split screen" example where the left camera uses RenderLayers to filter out the blue sprite.
![image](https://user-images.githubusercontent.com/2694663/178814868-2e9a2173-bf8c-4c79-8815-633899d492c3.png)
Note that this builds directly on #5146 and that @james7132 deserves the credit for the baseline visibility inheritance work. This pr moves the inherited visibility field into `ComputedVisibility`, then does the additional work of porting everything to `ComputedVisibility`. See my [comments here](https://github.com/bevyengine/bevy/pull/5146#issuecomment-1182783452) for rationale.
## Follow up work
* Now that lights use ComputedVisibility, VisibleEntities now includes "visible lights" in the entity list. Functionally not a problem as we use queries to filter the list down in the desired context. But we should consider splitting this out into a separate`VisibleLights` collection for both clarity and performance reasons. And _maybe_ even consider scoping `VisibleEntities` down to `VisibleMeshes`?.
* Investigate alternative sprite rendering impls (in combination with visibility system tweaks) that avoid re-generating a per-view fixedbitset of visible entities every frame, then checking each ExtractedEntity. This is where most of the performance overhead lives. Ex: we could generate ExtractedEntities per-view using the VisibleEntities list, avoiding the need for the bitset.
* Should ComputedVisibility use bitflags under the hood? This would cut down on the size of the component, potentially speed up the `is_visible()` function, and allow us to cheaply expand ComputedVisibility with more data (ex: split out local visibility and parent visibility, add more culling classes, etc).
---
## Changelog
* ComputedVisibility now takes hierarchy visibility into account.
* 2D, UI and Light entities now use the ComputedVisibility component.
## Migration Guide
If you were previously reading `Visibility::is_visible` as the "actual visibility" for sprites or lights, use `ComputedVisibilty::is_visible()` instead:
```rust
// before (0.7)
fn system(query: Query<&Visibility>) {
for visibility in query.iter() {
if visibility.is_visible {
log!("found visible entity");
}
}
}
// after (0.8)
fn system(query: Query<&ComputedVisibility>) {
for visibility in query.iter() {
if visibility.is_visible() {
log!("found visible entity");
}
}
}
```
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-07-15 23:24:42 +00:00
|
|
|
bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.8.0-dev" }
|
2022-07-10 21:04:35 +00:00
|
|
|
bevy_log = { path = "../bevy_log", version = "0.8.0-dev" }
|
2022-04-17 23:04:52 +00:00
|
|
|
bevy_math = { path = "../bevy_math", version = "0.8.0-dev" }
|
2022-05-31 22:53:54 +00:00
|
|
|
bevy_mikktspace = { path = "../bevy_mikktspace", version = "0.8.0-dev" }
|
2022-04-17 23:04:52 +00:00
|
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", features = ["bevy"] }
|
2022-05-30 18:36:03 +00:00
|
|
|
bevy_render_macros = { path = "macros", version = "0.8.0-dev" }
|
2022-07-11 23:19:00 +00:00
|
|
|
bevy_time = { path = "../bevy_time", version = "0.8.0-dev" }
|
2022-04-17 23:04:52 +00:00
|
|
|
bevy_transform = { path = "../bevy_transform", version = "0.8.0-dev" }
|
|
|
|
bevy_window = { path = "../bevy_window", version = "0.8.0-dev" }
|
|
|
|
bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" }
|
2020-04-06 03:19:02 +00:00
|
|
|
|
|
|
|
# rendering
|
2022-05-28 02:00:55 +00:00
|
|
|
image = { version = "0.24", default-features = false }
|
2020-04-06 03:19:02 +00:00
|
|
|
|
|
|
|
# misc
|
2022-07-14 21:17:16 +00:00
|
|
|
wgpu = { version = "0.13.1", features = ["spirv"] }
|
2021-12-22 22:16:42 +00:00
|
|
|
codespan-reporting = "0.11.0"
|
2022-07-14 21:17:16 +00:00
|
|
|
naga = { version = "0.9.0", features = ["glsl-in", "spv-in", "spv-out", "wgsl-in", "wgsl-out"] }
|
2020-05-26 01:27:04 +00:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
2020-09-10 19:54:24 +00:00
|
|
|
bitflags = "1.2.1"
|
2021-12-14 03:58:23 +00:00
|
|
|
smallvec = { version = "1.6", features = ["union", "const_generics"] }
|
2021-05-05 19:14:39 +00:00
|
|
|
once_cell = "1.4.1" # TODO: replace once_cell with std equivalent if/when this lands: https://github.com/rust-lang/rfcs/pull/2788
|
2020-09-10 19:54:24 +00:00
|
|
|
downcast-rs = "1.2.0"
|
2022-06-21 18:10:27 +00:00
|
|
|
thread_local = "1.1"
|
2020-05-16 02:30:02 +00:00
|
|
|
thiserror = "1.0"
|
2021-12-14 03:58:23 +00:00
|
|
|
futures-lite = "1.4.0"
|
|
|
|
anyhow = "1.0"
|
2020-08-30 18:27:37 +00:00
|
|
|
hex = "0.4.2"
|
2022-07-03 19:55:33 +00:00
|
|
|
hexasphere = "7.2"
|
2022-07-14 21:17:16 +00:00
|
|
|
parking_lot = "0.12.1"
|
2021-12-14 03:58:23 +00:00
|
|
|
regex = "1.5"
|
2022-01-08 10:18:22 +00:00
|
|
|
copyless = "0.1.5"
|
2022-03-15 22:26:46 +00:00
|
|
|
ddsfile = { version = "0.5.0", optional = true }
|
|
|
|
ktx2 = { version = "0.3.0", optional = true }
|
|
|
|
# For ktx2 supercompression
|
|
|
|
flate2 = { version = "1.0.22", optional = true }
|
|
|
|
ruzstd = { version = "0.2.4", optional = true }
|
|
|
|
# For transcoding of UASTC/ETC1S universal formats, and for .basis file support
|
|
|
|
basis-universal = { version = "0.2.0", optional = true }
|
2022-07-03 19:55:33 +00:00
|
|
|
encase = { version = "0.3", features = ["glam"] }
|
2022-07-04 09:14:04 +00:00
|
|
|
# For wgpu profiling using tracing. Use `RUST_LOG=info` to also capture the wgpu spans.
|
|
|
|
profiling = { version = "1", features = ["profile-with-tracing"], optional = true }
|