Hello, and I have been looking at using a web cam in a scene which requires post effects (specifically tone mapping) to the 3d content. I have so far been unable to rig the default rendering pipeline so that it excludes the background layer (with webcam texture) from post processing.
I have tried a variety of order of operations attempts (creating the nodes in different series), and auditing the rendering pipeline to see where it attaches or what alpha values effects are using, but found nothing which would suggest a fix.
Let me know if I can clarify anything further, and thanks for any help you might lend,
r
Thanks, although the 0x100fffff value did not work (vs 0x10000000, 0x20000000, 0x11000000, etc).
The getLastProcess loop, which assigns the ALPHA_COMBINE required the following additional settings in order to correctly clear the buffer before redraw (outside of the playground it was redrawing over each new frame).
const lastPostProcess = getLastPostProcess(defaultPipeline);
if (lastPostProcess) {
lastPostProcess.alphaMode = BABYLON_CONSTANTS.ALPHA_COMBINE;
lastPostProcess.autoClear = true;
// do not inherit scene clear color
lastPostProcess.clearColor = new Color4(0, 0, 0, 0);
lastPostProcess.forceAutoClearInAlphaMode = true;
}
The code change appears to clear the buffer between frames, but is causing new issues with particles. Is this the intended use? And are you doing anything additional in the Playground to ensure that buffers are being correctly refilled between frames?
Hey, and it’s deeply nested within a react project. The fix @sebavan suggested works within the project as it does within the playground, but redraws each frame over the previous without clearing it. The code above remedies the issue, but looks like it is clearing particles which have been rendered before the new frame begins.
Using two cameras is an option, but I have deferred looking into it while I debug the redraw problem.