Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Easy way to do a “visibility status”-check on a 2d/3d-point?

  • Easy way to do a “visibility status”-check on a 2d/3d-point?

    Posted by Johan Malmsten on November 20, 2009 at 11:29 pm

    I’m sure someone has done this before. I just can’t seem to get my wording right when I do google-searches and on this site.

    I want to know if there’s an easy way to do a “visibility check”.

    I mean. If I have a point, 2d or 3d. I want to be able to determine if that point is obscured by pixels of another layer. And as a bonus, maybe even know the sum-total of the alpha-channel change that the other layers are adding to the target-points pixel. The icing on the cake would be to get whatever color is being added to the point before its fully obscured.

    The common example: I have a lens flare that’s supposed to follow something in space. But at the same time I want stuff to obscure it. I could just put it in a layer beneath, but that would obscure all parts of the flare with all the opaque pixels in front. I want it so that it only reacts to when the target-point (the light-emitter) is obscured. Like in real life.

    I’m sure people have been using functions like this in some way. I just want to know how…

    Dan Ebberts replied 16 years, 9 months ago 3 Members · 2 Replies
  • 2 Replies
  • Gary Hazen

    November 21, 2009 at 5:51 pm

    Knoll Light Factory allows you to set the obscuration layer.

    You might be able to use expressions to do the same thing. But you’d need a smart guy like Dan Ebberts to do the math. Check the expressions forum.

  • Dan Ebberts

    November 22, 2009 at 12:13 am

    It’s tricky, but it can be done. You need to use toComp() to transfrom the 3D position of your source into view space, use fromCompToSurface() to transform that point onto the surface of each of the other layers in the comp, use sampleImage() to pick up the rgba for each of the other layers, and merge the alphas together (which is a tricky bit of math itself). That will tell you how much your point is obscured on the line between it and the camera. A project for a rainy afternoon perhaps.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy