-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
Split off from #19058
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.
This is exciting! The initial simplicity is appreciated.
if let Ok(mesh) = mesh.get(descendant) { | ||
commands | ||
.entity(descendant) | ||
.insert(RaytracingMesh3d(mesh.0.clone())) |
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.
This seems fine for demo purposes. I'd prefer it if ultimately raytracing could reuse the existing Mesh3d by default (as the component-swapping UX isn't great). Solvable problem / Im pretty sure I understand why you went for this in the short term (removing Mesh3d opts out of the normal rendering flow).
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.
Did you read the docs on RaytracingMesh3d? It was an intentional choice to allow using lower-resolution proxy meshes for RT (and to allow using proxy meshes for MeshletMeshes).
We could make reusing Mesh3d the default I suppose, and RaytracingMesh3d opt-in, but I'm not sure how I feel about that. I'll give it some more thought, it's not a bad idea.
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.
Yup! An opt-in override component makes way more sense to me from a UX perspective.
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.
Also yes removing Mesh3d here for the pathtracer is to opt-out of the normal rendering path.
The realtime stuff won't do that.
It's going to get so much more complicated soon :) Still simpler than virtual geometry though, by a long shot. |
Bevy Solari
Preface
Connections
This PR
After nearly two years, I've revived the raytraced lighting effort I first started in #10000.
Unlike that PR, which has realtime techniques, I've limited this PR to:
RaytracingScenePlugin
- BLAS and TLAS building, geometry and texture binding, sampling functions.PathtracingPlugin
- A non-realtime path tracer intended to serve as a testbed and reference.What's implemented?
What's not implemented?
End-user Usage
SolariPlugin
to your appMesh
asset you want to use for raytracing hasenable_raytracing: true
(defaults to true), and that it uses the standard uncompressed position/normal/uv_0/tangent vertex attribute set, triangle list topology, and 32-bit indices.RaytracingMesh3d
component to your entity (separate fromMesh3d
orMeshletMesh3d
).Testing