SCNParticleSystem partially hidden or occluded in wrong manner

256 views Asked by At

I have an issue with particle systems, which can be, in rare cases, kind of occluded in a wrong manner. The particle system you see on the print-screens is a sphere (with invisible material, material transparency = 0.0), that emits particles from its surface. Like 250 particles per second - no magic - and the particle systems works in 99% as it should.

You see also a floor (which is a SCNPlane) that has a very large diameter, of like 100m x 100m. The occlusion happens when the camera is flying by and the angle of the view changes a little bit, because the camera moves smoothly. Depending on the camera angle, it can happen - as you see on the second image - the particle system is occluded partially in a wrong manner, like it would stay behind the horizon - but it does not - it hoovers 2m above the floor and has a radius of 1m.

Did anyone ran into a similar issue? Is there something that could be done, to make this render correctly in all cases (from all viewing angles).

Sometimes the particle system disappears even completely. i.Ex when the camera looks from (20m) above directly on the particle system.

Good Particle System Bad Particle System

(The scene uses physically based rendering using SceneKit - the background is a simple skybox)

2

There are 2 answers

4
stipus On

You asked if anyone ran into a similar issue? I can answer yes!

Depending on the point of view (camera position), and the object on which the SCNParticleSystem is attached, I'm getting weird occlusions of the emitted particles.

I have no SCNPlane, but I have a large SCNSphere around the scene showing a 360 video. If I remove the sphere, the bug doesn't occur anymore.

It might be a regression with iOS 14.x and macOS 11.2, as the same application running under iOS 13.6.1 doesn't show the problem !

0
alex sheh On

If somebody needs. I had similar problem and was trying to set different settings of the particle system for a while. One of solutions was increased "Rendering order" of the node, that contains the particles, but particles disappear if you change camera orientation. By chance, I discovered that bug happens when I add specific node to the scene. One difference I found, this node had a material with Transparency mode "Dual layer". I tried this one to make transparent texture. I changed mode to "Default" and it helped. Xcode screen