optimize the performance (fps) of mesh detector in xrblocks#144
optimize the performance (fps) of mesh detector in xrblocks#144JFGVL1187 merged 2 commits intogoogle:mainfrom
Conversation
|
I'd prefer to hold off on this change until your Chromium CL is submitted. When we're not rendering anything, we should still be able to get 72 fps on Galaxy XR but it's not the case yet. |
|
No Problem. I published this PR so that you can also fetch it and try other optimization methods, e.g. batch rendering if needed. |
|
also do an |
38a7a31 to
6cb5dad
Compare
| } | ||
| } | ||
|
|
||
| dispose() { |
60ff834 to
1cf93c2
Compare
4603d59 to
845a4e7
Compare
| this.lastMeshUpdateTime = now; | ||
|
|
||
| // Remove meshes no longer in detectedMeshes (from Blink layer) | ||
| // this.cleanupUndetectedMeshes(meshes); |
There was a problem hiding this comment.
Have removed this.
| frame, | ||
| referenceSpace | ||
| ); | ||
| // const isVisible = this.shouldShowMeshInViewWithFrustum(xrMesh, frame, referenceSpace); |
There was a problem hiding this comment.
Have removed this.
|
|
||
| // Compute mesh bounding box (AABB) | ||
| private computeMeshBoundingBox(xrMesh: XRMesh): { | ||
| min: THREE.Vector3; |
There was a problem hiding this comment.
Why don't we use THREE.Box3?
There was a problem hiding this comment.
Have switched to THREE.Box3
There was a problem hiding this comment.
This is helper func for shouldShowMeshInViewWithFrustum() which should not be used. For efficiency, we are using an approximate method of shouldShowMeshInViewWithFrustum().
| const SEMANTIC_COLORS = [0x00ff00, 0xffff00, 0x0000ff]; | ||
|
|
||
| // Frustum plane structure: plane equation ax + by + cz + d = 0 | ||
| interface FrustumPlane { |
There was a problem hiding this comment.
Why don't we just use THREE.Plane?
There was a problem hiding this comment.
Have switched to THREE.Plane
845a4e7 to
08963b5
Compare
08963b5 to
9fa2529
Compare
|
Fyi there is https://threejs.org/docs/#Frustum |
For work collaboration, not for merge yet.