0

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)

ZAY
  • 3,882
  • 2
  • 13
  • 21

2 Answers2

0

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 !

stipus
  • 56
  • 6
  • Interesting to hear... have you any suggestion or workaround to get rid of that strange occulusion? – ZAY Apr 16 '21 at 06:57
  • Unfortunately no. Did you experience the problem under macOS and/or iOS ? If I add the same particle system to another object, it doesn't happen.It looks like it happens only when the object on which the particle system is attached is hidden by another geometry. It might be a bad SceneKit optimisation... if the object is occluded by another object, then its particles are also hidden... – stipus Apr 16 '21 at 07:00
  • I only develop for iOS, so I have no idea, if it happens as well on MacOS. In my particular case, this system occludes occasionly. When the character runs towards it and the camera faces some minor different angles to to particle system, then one second it is occluded, then it return to normal, then again, it gets occluded - then I run the character in the other direction, and it gets normal again. It's really strange. Did you file a bug to Apple? – ZAY Apr 16 '21 at 07:17
  • The problem looks very similar. I have a SCNNode object that hovers in front of the camera. This SCNNode object has an SCNParticleSystem attached. As the object is hovering, its y position is slowly updated up and down, and this makes the SCNParticleSystem sometimes blink (for one second it's hidden, then it is shown again). If I move the camera a little, then it doesn't happen anymore. I didn't fill a bug report yet, as I would need to create a demo app to show the bug, and I currently don't have enough time. – stipus Apr 17 '21 at 10:03
0

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