Does MaskPass work with gradients?

Hello! I have a MaskPass set up to allow a background image to show through some cards distributed in a circle. However, I want to have each card be filled with a black to white gradient to create distinctions between the cards. I have the cards filled with the black to white gradients, but that isn’t rendering in final result. Does MaskPass only check the boundary of the geometries in the mesh or does the rendered color of the mesh affect the result of the MaskPass?

this should not require post processing. do you have an image or something that explains what you are going for visually? i keep thinking rendering into a texture is all you need, or stencil.

Colors do not affect the result of MaskPass. MaskPass (in combination with ClearMaskPass) makes use of the stencil buffer and controls the stencil test in your post processing chain.

Here’s the mask scene (several planes that I want to be able spin):

And here’s my current result with MaskPass:

Can this be achieved using a texture or stencil? I’m about to try a ShaderPass.

An abstract color gradient as pass-through background could be emulated with spot lights, and without MaskPass, ClearMaskPass or ShaderPass. Most likely it is not what you are going after, but since I already wrote it, here it is:

https://codepen.io/boytchev/full/OJrNRer

image

3 Likes

or fog, that would also cut off the cards.

2 Likes

This is really cool, I never would have thought of it! I’m trying it out now…

1 Like

I’ll give the fog a shot too! :pray: