Transparent masking of an object

Hi all:

I’m a new Panda3d user, sorry if I don’t know all the etiquette of this forum yet!

I have several object(s) placed in a scene and would like to make one or more of the objects “transparent” in places. That is, some of the object gets rendered, but in other places, the object is not rendered, and instead, whatever is behind it shows through (unless it too is masked, separately). That is, I want to “mask” specific objects in a scene with per-object “transparency-creating” mask.

I would like to be able to define the mask by some arbitrary 2-D shape that I somehow introduce into the scene, but it would be even better if I could also do automatically mask anything along a given projection from another object also in the scene.

I’ve tried to use the existing Panda docs on depth masking, buffers, and stencils to achieve this. However, I haven’t had much luck. Are these the right tools to be using? If so, some more detailed guidance on how to achieve what I need what be great. If not, could you point me to what I should be looking at?


You could either project an alpha texture on specific objects or implement the masking as a post processing effect with two rendering passes (one extra for the special, potentially transparent objects). The latter could be implemented nearly the same as the glow effect in the tron sample, except you would not make the special areas glow, but use them as a mask layer for the second rendering pass.

I’m not an effects guy, so there might be way better ways (pun not intended).

Unless the only thing you’re really trying to achieve is an object with some transparent pieces. In this case, you just paint the transparent parts into the alpha channel of the object’s texture.