Grab pass with premultiplied alpha

Hello!

I noticed after upgrading from version 1.53.4 of the engine to the latest one that materials with the blend type pc.BLEND_PREMULTIPLIED no longer seem to be rendered to the buffer texture_grabPass or uSceneColorMap as it has been renamed since. I tried to reproduce the issue in the “Grab Pass” sample (PlayCanvas Examples) and it seems to happen for any other blend type than pc.BLEND_NONE.

Below is a screenshot with a minimal incision in the code that changes the blend mode for all primitives except the one that samples the background in its shader. The visual result is that those primitives are fully occluded when behind. Could there be some scene setting that needs to be changed? Forcing a draw order with layers unfortunately didn’t seem to help.

Sincerely

  • Dave

You can change the order of the Depth Layer to where you’d find more appropriate, that is where the grab takes place - see more here
https://developer.playcanvas.com/en/user-manual/graphics/cameras/depth-layer/

But note that the result can only be used on the following layers of it.

3 Likes

That did the trick. Thanks for the quick response @mvaligursky!

Sincerely

  • Dave
1 Like