Hello!
I’ve been working on developing a mixed reality visionOS app by using Polyspatial component in Unity recently, but I’ve run into some issues when using the Particle System.
When I expected a Particle Effect to work at a certain node, it didn’t appear as I had anticipated. Upon investigating the cause of the problem, I found that when I adjusted the rendering properties of the particle effect system, changing the Render Mode to “Mesh” or “Stretched Billboard”, the Particle Effects wouldn’t display in the “Game” window, but they would appear correctly in the “Scene” window. At the same time, Particle Effects Render Mode in “Billboard” and both “Vertical/Horizontal Billboard” would display correctly in both “Game” and “Scene” windows.
During my adjustments, for the “Mesh” mode, I used Unity’s built-in cube mesh, and the materials and shaders remained unchanged throughout. I’d like to know what might be causing this issue and whether it’s related to any unique properties of Polyspatial, such as not supporting certain rendering modes for Particle System.
Here is my screenshot for Render Mode setting
In the PolySpatial settings, what is your Particle Mode set to? The Replicate Properties mode does not support mesh or stretched billboard particles, due to lack of support for them in RealityKit’s ParticleEmitterComponent. The Bake to Mesh mode should support both meshes and stretched billboards, but be aware that Bake to Mesh has a performance cost that will increase with the number of particles (because the particle mesh must be sent to RealityKit at each frame).
When using Bake to Mesh, setting the particle renderer to Mesh crashes both Play to Device and builds for me. I get this error in builds: Thread 1: Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value
Other issues:
There doesn’t seem to be a way to render both sides of a rotating particle.
URP/Particles/Unlit and custom shaders can only render front faces.
URP/Lit, which can render both sides, causes magenta particles.
This might be an issue with mesh data that we’ve fixed for the next version, though I’d have to see the entire stack trace to be sure. If it doesn’t sound like that and you can submit a bug report with a repro case (and let us know the incident number: IN-#####), we can take a look.
Right; this is due to a limitation in RealityKit: ShaderGraphMaterials don’t have an option to control the cull face. I see in the other thread that you also submitted feedback to Apple requesting this, which is great.
I’m surprised that they’re magenta, but URP/Lit typically won’t work well for particles because it doesn’t incorporate the vertex color (which is how the particle color/alpha values are controlled). The next release will add support for URP/Particles/Lit, though that uses shader graphs (which is the only way that we can use vertex colors in RealityKit), which means that it won’t support double-sided rendering.