Initial raytraced lighting progress (bevy_solari)#19058
Initial raytraced lighting progress (bevy_solari)#19058cart merged 93 commits intobevyengine:mainfrom
Conversation
cart
left a comment
There was a problem hiding this comment.
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.
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.
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.
Yup! An opt-in override component makes way more sense to me from a UX perspective.
There was a problem hiding this comment.
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
SolariPluginto your appMeshasset 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.RaytracingMesh3dcomponent to your entity (separate fromMesh3dorMeshletMesh3d).Testing