在postprocess 获取深度图 代码如下:
let input = this.lastPass.slotName(camera, 0);
let forwardPass = builder.getPass(ForwardPass);
let depth = forwardPass.slotName(camera, 1);
let output = this.slotName(camera);
const cameraID = this.getCameraUniqueID(camera);
context
.updatePassViewPort()
.addRenderPass('post-process', `${this.name}${cameraID}`)
.setPassInput(input, 'inputTexture')
.setPassInput(depth, 'depthTexture')
.addRasterView(output, gfx.Format.RGBA8)
.blitScreen(0)
.version();
然后直接显示深度图:
不知道哪儿出错了。
