我正在尝试在AR SceneKit演示的后处理步骤中进行深度测试。为此,我需要渲染器ARSCNView的深度图。使用SCNTechnique似乎无法获得它。
尝试将DRAW_SCENE传递的深度用作SCNTechnique的DRAW_QUAD传递的输入时,我一直保持空白(充满1.0-s)深度缓冲区。我遵循了SCNTechnique上的指南,并命名了深度目标。这是SCNTechnique实施中的错误,还是我在配置中缺少某些内容?
颜色缓冲区已正确链接,并且https://github.com/lachlanhurst/SCNTechniqueTest/tree/pixelate中的示例适用。
这是技术列表:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>passes</key>
<dict>
<key>pixelate_scene</key>
<dict>
<key>draw</key>
<string>DRAW_SCENE</string>
<key>inputs</key>
<dict/>
<key>outputs</key>
<dict>
<key>color</key>
<string>color_scene</string>
<key>depth</key>
<string>depth_scene</string>
</dict>
<key>colorStates</key>
<dict>
<key>clear</key>
<true/>
<key>clearColor</key>
<string>sceneBackground</string>
</dict>
</dict>
<key>resample_pixelation</key>
<dict>
<key>draw</key>
<string>DRAW_QUAD</string>
<key>program</key>
<string>doesntexist</string>
<key>metalVertexShader</key>
<string>pixelate_pass_through_vertex</string>
<key>metalFragmentShader</key>
<string>pixelate_pass_through_fragment</string>
<key>inputs</key>
<dict>
<key>colorSampler</key>
<string>color_scene</string>
<key>depthSampler</key>
<string>depth_scene</string>
</dict>
<key>outputs</key>
<dict>
<key>color</key>
<string>COLOR</string>
</dict>
</dict>
</dict>
<key>sequence</key>
<array>
<string>pixelate_scene</string>
<string>resample_pixelation</string>
</array>
<key>targets</key>
<dict>
<key>color_scene</key>
<dict>
<key>type</key> …Run Code Online (Sandbox Code Playgroud)