WebGPUPathTracer: Add support for SkinnedMeshes#729
WebGPUPathTracer: Add support for SkinnedMeshes#729gkjohnson wants to merge 9 commits intowebgpu-pathtracerfrom
Conversation
|
@TheBlek - one thing I noticed while working on this was what looks like a floating point difference between the megakernel and wavefront kernel approach. You can see that there are some black artifacts in the megakernel one that aren't in the wavefront image. Is there a different offset being applied after hit somehow? Any thoughts? Megakernel
Wavefront
You can repro it by loading this glb model and adding it to the scene like so: new GLTFLoader().loadAsync( MODEL_URL ).then( gltf => {
gltf.scene.traverse( c => {
if ( c.isSkinnedMesh ) {
scene.add( new Mesh( c.geometry ) );
}
} );
pathTracer.setScene( scene, camera );
} ); |
| } | ||
|
|
||
| // Get skinned vertex positions | ||
| mesh.getVertexPosition( ai, _v0 ); |
There was a problem hiding this comment.
Using getVertexPosition each time bounds for a triangle is requested does feel inefficient. Each vertex will be requested at least once, and probably more than that. So they can be calculated once and cached. Worth noting somewhere, that further improvements could probably be made to build speed at cost of memory. Perhaps its worth adding a benchmark case for skinned mesh build speed?
| const indirectBuffer = this._indirectBuffer; | ||
| const index = geometry.index ? geometry.index.array : null; | ||
|
|
||
| const tri = indirectBuffer ? indirectBuffer[ i ] : i; |
There was a problem hiding this comment.
Is this equivalent to resolvePrimitiveIndex? If so, perhaps its best to use that for consistency?


cc @TheBlek