简体   繁体   English

是否有可能在场景工具包中的半透明物体后面渲染粒子?

[英]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. 我正在尝试使用Scenekit,当我尝试在半透明对象后面渲染粒子时,我遇到了一个问题。 They simply don't render while other objects in the scene do. 它们根本不会在场景中的其他对象进行渲染时进行渲染。

在此输入图像描述

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. 我试过google / stackoverflow它,但似乎scenekit不是一个很好的主题。

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. 使用Alpha混合时,渲染器会读取帧缓冲区中的当前值,并在这些值的顶部混合半透明颜色。

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. 使用SceneKit,绘制顺序可以由场景节点上的renderingOrder属性控制。

The order the node's content is drawn in relative to that of other nodes. 节点的内容相对于其他节点的顺序。

Apple Docs Apple Docs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Sprite Kit中是否可以将场景推到另一个场景之上? - Is it possible to push a Scene on top of another in Sprite Kit? Swift-在View Controller中的Sprite Kit场景后面添加背景图像 - Swift - Adding background image behind a Sprite Kit Scene in View Controller 运行场景(场景工具包)? - run scene (scene kit )? 是否可以确定所有Sprite Kit场景冲突都已播出? - Is it possible to determine that all Sprite Kit scene collisions have played out? 是否可以在透明部分标题后面“隐藏” UITableViewCell ? - Is it possible to “hide” a UITableViewCell behind a transparent section header? Sprite Kit中的单个粒子和物理 - Individual particles and physics in Sprite Kit 为另一个半透明视图后面的视图调用[view setNeedsDisplay]不会调用drawRect:吗? - Does calling [view setNeedsDisplay] for a view behind another semi-transparent view not invoke drawRect:? SceneKit:几何体在半透明纹理后面不可见。 盒中盒 - SceneKit: Geometry not visible behind semi-transparent texture. Box inside Box 如何在Scene Kit中更改场景? - How to change scene in Scene Kit? 是否可以在uikit视图层次结构的顶部添加透明BG的SpriteKit场景? - Is it possible to add a SpriteKit scene with transparent BG on top of a uikit view hierarchy?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM