The visual streaming part works perfectly. I am successfully streaming over 25 massive Gaussian splats (representing entire neighborhoods with millions of points), which I am currently hosting externally via GitHub Pages.
My Problem: I am trying to add collisions to these environments so the player/camera cannot fly through the walls and floors, but no matter what I do, I just fly straight through everything.
What I have done so far:
I created collision meshes for these spaces using two different methods:
Voxelizing the .ply point clouds to generate .glb meshes.
Manually modeling low-fidelity boundaries in Blender.
Right now, I am uploading these .glb collision meshes directly into the PlayCanvas Editor (though, because of their size, I would prefer to load them dynamically from an external URL in the future).
I am following the exact same procedure used in the LOD tutorial (adding a Collision component set to Mesh, and a RigidBody component set to Static on an Entity), and aligning it with the splat.
Despite setting it up exactly like the tutorial, the physical boundaries are completely ignored by my character controller.
Does anyone know what I might be missing? Are there specific tricks or settings required to make Mesh Colliders work alongside dynamically streamed Splats?
Any advice or pointers would be hugely appreciated! Thank you!
You could try running a simple sphere intersection test on the point cloud that centers on the camera. I believe this is also called a capsule cast might drop performance but you could probably find a way to weave it in between frames or run on a thread. You can also try following this tutorial for your use case https://youtu.be/fCtOUtUCSmM?si=t5SSAaBFPzMrLOOF.
Additionally there could be an initialization issue with the layering of how you are putting the collision meshes in they may not be on the same layer. To be frank this is very little information to draw a conclusion from, I could look at the code and take a look. My only other hypothesis is that your lods are not being synced to the collision mesh. Lods are technically different files, the implementation methods can vary however. It could also be that your not passing the mesh to the active lod and its only staying on one lod / the main full scene.
Thank you for your comment, Nolan! I think it could be your hypothesis about the LOD synchronization or that my "main splat” entity is not passing the collision to the different streamed LOD splats. However, I am not very experienced in PlayCanvas yet, as this is my first project inside of this engine. If you would offer your support on this issue, I’d greatly appreciate it! I can add you to the project, or you can use this link:
rendering of streamed splats is not related to collision in any way, those are completely independent systems.
even if you rendered no splats, you collision will work when set up right. I’d suggest you check some tutorials on how collision needs to be set up: Tutorials | PlayCanvas Developer Site
2 things right off the bat I use the api and code from scratch to make my apps normally so just a disclaimer. Second so yeah the way lod-meta.json works is its literally an index for the lod files that are generated however there is no default per lod alignment its just a level of detail so while it could cause issues with the collision ive deemed it unlikely.
I need the following information:
without lod’s how is it
is there a collision mesh at all being “rendered” ie I would make some debug utility to display a wiremesh of the collision fram using a gsplat processor instance and setting that to a texture stream for an overlay. I can show you how to do that but if you read the engine api docs on the gsplat processor that may be enough.
are you tying your lod’s to the collision : This is a big no no the character controller must never depend on render lod if you sync them you can get the following as byproduct
jitter, falling through terrain, physics rebuild hitches.
your goal should be Stable collision layer + independent visual LOD - I would suggest creating a dedicated collision world
never swaps
never streams aggressively
always stays loaded near the player
Character controller only talks to collision nothing else once you have the collision working regardless of visuals you can then fit the visuals to the collision mesh.
LOD’s use heirarchial octree rendering in essence meaning - each chunk or node when used in LOD streaming is different that means your scene and frame is made of mixed lod chunks across the scene NOT a global switch. Your buttons for detail level if you have implemented lod streaming properly will just trample over the whole system if you try to run streaming AND a static quality at the same time this could be your main issue make sure its handled with care. you can take a separate approach if a quality filter is what you want by creating an fps throttle to force certain lod boundaries ie set to lower lod if fps drops to x amount.
You are mixing concepts up in your project make sure if you want 2 separate concepts or features to work in tandem that you ensure they do not run on the same resources, have conflicts, or race conditions. If they do you will have to manually account for that as is being a developer.