小编Aro*_*art的帖子

SCNTechnique的DRAW_QUAD传递中ARSCNView的空白深度缓冲区

我正在尝试在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)

depth-buffer ios metal scntechnique arkit

5
推荐指数
1
解决办法
176
查看次数

标签 统计

arkit ×1

depth-buffer ×1

ios ×1

metal ×1

scntechnique ×1