问题描述
我一直在尝试将 Stencils 与 SCNTechnique
一起使用。
即使我将其简化为最简单的设置,如下所示:
"sequence": ["stencilFillPass"]
"passes": {
"stencilFillPass": {
"outputs": {
"color": "COLOR","depth": "DEPTH"
},"stencilStates": {
"enable": true,"behavior": {
"writeMask": true,"depthFail": "zero","pass": "replace","readMask": 0,"referenceValue": 255
"fail": "zero"
"function": "always"
},"clear": true
},"draw": "DRAW_SCENE","includeCategoryMask": 1
我总是收到这个错误:
validateAttachmentOnDevice:457: failed assertion `PixelFormat MTLPixelFormatStencil8 is not depth renderable'
我在网上找不到任何人能够将 Stencils 与 SceneKit+Metal 结合使用:
- This user describes how they use stencils,but leaves the footnote that they can only get it to work in OpenGL
- This article mentions they couldn't get stencils to work
- This post on Apple developer forum has similar issues to me.
似乎它在 OpenGL 时代确实有效。
因此,向任何能够让 Stencils 与 SceneKit 和 Metal 一起工作的人发出呼吁。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)