-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Initial raytraced lighting progress (bevy_solari) #19058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 60 commits
e28c8c8
f42c25b
58507ba
fdf123f
f9e5aa2
cfb1ba2
92997a0
7224fcd
e7b9aa5
c9dd3ab
c635e31
182e88b
27abb14
135bcb4
e9ea256
324f1be
491effd
60d86b3
e60addf
e387883
231ca08
0b0db2c
5ff7c4d
7ebea4a
45bd908
f0e13b2
f2873c0
c8eddb3
6e78a94
d4e4dba
5959cdd
6804f61
757c1e5
f89e2f7
4f5a2ec
18cb7fc
305c015
4354944
123628a
63272d1
1f051f8
4005334
7bc608f
b9134ee
5f79f7a
4c6abfe
49166b1
a4ef1f0
044474a
f26e0c1
7dc5458
d25d52e
9adcdd0
2dc2589
eb48343
d80f376
7753735
51c5f56
86f2aa2
c5e178a
a31e549
f83a666
e070d7b
569b85d
45bcffd
1f21410
8ab295a
948dfa9
a3f9edb
01465b5
3c18ea2
bee4d51
def2300
ef1f736
31f7a49
a700bd3
87d8d30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,18 @@ pub struct Mesh { | |
morph_targets: Option<Handle<Image>>, | ||
morph_target_names: Option<Vec<String>>, | ||
pub asset_usage: RenderAssetUsages, | ||
/// Whether or not to build a BLAS for use with bevy_solari raytracing. | ||
/// | ||
/// Note that this is _not_ whether the mesh is _compatible_ with bevy_solari raytracing. | ||
/// This field just controls whether or not a BLAS gets built for this mesh, assuming that | ||
/// the mesh is compatible. | ||
/// | ||
/// The use case for this field is setting it to true for low resolution proxy meshes you want to use for raytracing, | ||
/// and false for higher resolution versions of the mesh that you want to use for raster. | ||
/// | ||
/// Does nothing if not used with bevy_solari, or if the mesh is not compatible | ||
/// with bevy_solari (see bevy_solari's docs). | ||
pub enable_raytracing: bool, | ||
} | ||
|
||
impl Mesh { | ||
|
@@ -203,6 +215,7 @@ impl Mesh { | |
morph_targets: None, | ||
morph_target_names: None, | ||
asset_usage, | ||
enable_raytracing: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this being true mean its building a BLAS for all meshes even when bevy_solari is not in use? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about instead, defaulting to false, and having a method on Mesh which checks the set of vertex attributes is {{POSITION, NORMAL, UV_0, TANGENT}} before setting the bool to true, and returns an error otherwise? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Depends by what you mean by "not in use". If the solari scene plugin is added to the app, your GPU supports RT, and the mesh is compatible and has enable_raytracing: true, then yes the mesh will get a BLAS built. If the plugin is not loaded (it's not part of default apps) / your GPU does not support RT, or the mesh is not compatible or has RT off, then no a BLAS won't be built.
The raytracing_enabled field is not meant to be "whether or not the mesh is compatible for RT". The field is meant for cases where you don't want to build a BLAS for a mesh even if it's compatible. E.g. for higher level LODs if you're using exclusively lower level LODs for RT to reduce BLAS and traversal cost. I'll update the docs to make this explicit. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[package] | ||
name = "bevy_solari" | ||
version = "0.16.0-dev" | ||
edition = "2024" | ||
description = "Provides raytraced lighting for Bevy Engine" | ||
homepage = "https://bevyengine.org" | ||
repository = "https://github.com/bevyengine/bevy" | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["bevy"] | ||
|
||
[dependencies] | ||
# bevy | ||
bevy_app = { path = "../bevy_app", version = "0.16.0-dev" } | ||
bevy_asset = { path = "../bevy_asset", version = "0.16.0-dev" } | ||
bevy_color = { path = "../bevy_color", version = "0.16.0-dev" } | ||
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.16.0-dev" } | ||
bevy_derive = { path = "../bevy_derive", version = "0.16.0-dev" } | ||
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev" } | ||
bevy_math = { path = "../bevy_math", version = "0.16.0-dev" } | ||
bevy_mesh = { path = "../bevy_mesh", version = "0.16.0-dev" } | ||
bevy_pbr = { path = "../bevy_pbr", version = "0.16.0-dev" } # TODO: Ideally remove this dependency | ||
bevy_platform = { path = "../bevy_platform", version = "0.16.0-dev", default-features = false, features = [ | ||
"std", | ||
] } | ||
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev" } | ||
bevy_render = { path = "../bevy_render", version = "0.16.0-dev" } | ||
bevy_transform = { path = "../bevy_transform", version = "0.16.0-dev" } | ||
|
||
# other | ||
tracing = { version = "0.1", default-features = false, features = ["std"] } | ||
derive_more = { version = "1", default-features = false, features = ["from"] } | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"] | ||
all-features = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're gonna need to wait until we can use a published version here