Hello together, I’ve found a strange bug regarding screenshots and clearcoat:
After disabling the clearcoat property of an PBRMaterial the object becomes invisible within the next Screenshot. If I do another screenshot afterwards the object becomes visible again (within the screenshot). It doesn’t seem to be a timing issue. Even if I wait a few seconds the object is still invisible in the screenshot.
I’m using BABYLON.Tools.CreateScreenshotUsingRenderTargetAsync for the screenshot.
For disabling the clearcoat property I’m only setting mat.clearCoat.isEnabled to false
Playground:
Press “Sceenshot” → screenshot looks fine
Press “Remove Clearcoat” → rendering looks fine
Press “Screenshot” → sphere is missing in screenshot
Not sure if this helps, but I just found out, that this bug only applys to CreateScreenshotUsingRenderTarget and CreateScreenshotUsingRenderTargetAsync.
CreateScreenshot and CreateScreenshotAsync seems to be working as intended.
As an additoinal site node: I’ve just tested it in some older projects of mine. I was able to reproduce the issue with babylon version 5.0.3 but not with 4.2.0.