Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Obscure Lens Flares with 3D clouds

  • Obscure Lens Flares with 3D clouds

    Posted by Lord Scales on November 30, 2007 at 6:19 pm

    Hi there!
    I made a project with some Fractal Noise clouds and a sun (the Lens Flare effect, which I made “3D” with toComp () function). I’ve also got a camera in the project.

    But there is a problem: Dan’s obscuration expression

    target = thisComp.layer(“clouds”);
    alpha = target.sampleImage(effect(“Lens Flare”)(“Flare Center”),[3.5, 3.5])[3];
    linear(alpha, 0, 0.36, 80, 10)

    doesn’t work properly (the Lens Flare obscures even with no clouds in front of the flare).
    I think it is because my cloud layer is 3D and I generated it’s Alpha Channel with a free plug-in called XMult (and I changed it’s scale and rotation).

    I need a solution for it. I tried a lot of Space Transforms but one worked less that the others.

    Thank you.

    Trent Armstrong replied 18 years, 4 months ago 3 Members · 6 Replies
  • 6 Replies
  • Kevin Camp

    November 30, 2007 at 7:15 pm

    try changing the sample image channel to a channel other than alpha (since technically it has no alpha)… if your clouds are black and white fractal noise, maybe try the red the red channel. change the ‘alpha =’ line to something like this:

    alpha = target.sampleImage(effect(“Lens Flare”)(“Flare Center”),[3.5, 3.5])[0];

    i just changed the [3] (alpha channel) value to [0] (red channel).

    you may be able to get better results by converting the image’s color space prior to pull the value for transparency.

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

  • Lord Scales

    November 30, 2007 at 7:26 pm

    It has an alpha channel. If you look at “Info” (only with the clouds turned on) alpha channel value changes.

  • Lord Scales

    November 30, 2007 at 8:40 pm

    Well, I found a solution: I just pre-composed my 3D clouds and turned on the “collapse transformation” switch and my obscuration worked fine.

    However, if anyone of you has an expression solution, it’d be very very welcome.

  • Kevin Camp

    November 30, 2007 at 8:41 pm

    just downloaded xmult… you are right, it does create a true alpha.

    however, i did a quick test and your expression is working for me… i applied the expression to the flare brightness and as i drag the flare center around i get values that increase over the transparent areas of the clouds and decrease over the opaque areas…

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

  • Lord Scales

    November 30, 2007 at 8:52 pm

    Strange, here it does not and I can’t find out why. Anyway, with the pre-composing I achieved my effect.

    Thanks.

  • Trent Armstrong

    December 10, 2007 at 11:02 pm

    There is one hang up here. I’m not sure if this applies to what you are doing but the layers all have to be the same dimension for the expression to work in the right places.

    The precomping idea is the best there if you have to have a 3D layer that is not the right dimensions.

    Trent

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