Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to render particles behind semi transparent objects in scene kit ?

I'm trying out Scenekit and I'm running into an issue when I'm trying to render particles behind semi transparent objects. They simply don't render while other objects in the scene do.

enter image description here

On this pictures all particles are in front of the semi transparent box, all particles that are behind are not displayed. You can see that the sphere is properly displayed and the colors of the covered part are attenuated. I would expect the same from the particles but maybe the rendering choices of the framework to make particle systems efficient make this kind of behaviour normal ?

I've tried to google/stackoverflow it, but it seems that scenekit is not a very well covered topic.

like image 727
Xav Avatar asked Oct 13 '15 15:10

Xav


1 Answers

Translucency depends heavily on draw order. With alpha blending the renderer reads the current values in the frame buffer, and mixes in the translucent color on top of those values.

What this means is that opaque objects should be drawn first and translucent objects should be drawn from back to front. If opaque objects are drawn after translucent objects the renderer has no current colors to mix with.

With SceneKit the draw order can be controlled by the renderingOrder property on the scene node.

The order the node’s content is drawn in relative to that of other nodes.

Apple Docs

like image 108
Justin Meiners Avatar answered Sep 24 '22 20:09

Justin Meiners