Lens Flare on 3D Lights?

After Effects lights can be moved around in 3D space but a lens flare effect can only move in 2D space on the X and Y axis. So how can you add a 2d lens flare to a 3D moving light?

The secret is using a simple expression on the “Flare Center” of the lens effect.

1. Alt Click on Flare Center stop watch to add expression

2. Type this in the expression box:

thisComp.layer(“Light 1“).toComp([0,0,0]);

NOTE: Just change “Light 1” to the name of your light.

This tip can be found in the bump map tutorial around 6:15 for those who would like to see it in action. View Tutorial

Dan Ebberts has an ever useful “3D Lens Flare” case study on his website that includes distance falloff. Check that out.

Here is an anamorphic lens flare project too.

POSTED:
10 years ago
RECENT POSTS
Incredible Paris Opening Titles!
Just got to London to begin the Video Copilot LIVE! Tour. Sleep schedule is almost adjusted! Saturday we’ll be in London and Paris is next week! There are still some tickets for Paris if want to come! Video Copilot LIVE! 2019 Show Tickets and Information! Beautiful Title sequence created by: Mehdi HADI Please follow!   View […]
Title Sequence for London Show!
One of the more exciting things about our upcoming Europe Tour is collaborating with amazing designers to develop a unique Title Sequence for each city. We are thrilled to release the first title sequence right now! Cinema 4D, After Effects helping to make it happen! Tickets for the show are available now! Huge thanks to stuz0r […]
Bold Type Project!
Sometimes you need to create a title that feels IMPORTANT without making it too flashy! One way to do that is with a texture and a cinematic fade! Usually a simple opacity fade leaves graphics looking washed out, but by color correcting the fade out, you can add color and contrast to the fade! I […]
New Tutorial: CROSSFIRE! + Video Copilot LIVE! Europe Tour!
BOOM! Hey what’s up! Our new Tutorial is online AND we’re excited to announce Video Copilot is going on Tour! We’ve been looking for new ways to get together with the community and showcase other amazing designers at a fun show! We are happy to finally share all the details! Get Show and Ticket Info […]
PLUG-INS
54 Comments

5 years ago
For anyone having problems with this I believe the expression has been updated:

L = thisComp.layer("Light 1")
LCP = L.toComp([0,0,0,]);

Use this and it should attach your flares directly to your lights.
Akira
5 years ago
Hi
Can you parent the light on the flare's position?
Or
Can I change 'z' without changing the 'x' and 'y'?
Please reply!!
Kyle
6 years ago
Every time I try to do this I get an "After Effects warning: Syntax error Expression disabled."

This expression seems like it should be simple enough to do? Anyone else getting this problem??
Archayl
6 years ago
Thanks! This tips helps me out a lot!
Theo K..
7 years ago
This expression is incredibly helpful. I'm inspired to start learning more about expressions also. Thank you so much.
8 years ago
thanks for ur help
giantsand
9 years ago
Oh! He also thinks your saying "butt mapping".... awesome!
giantsand
9 years ago
Andrew... gotta tell you. My 2 sons (7 and 9) have been watching your tutorials with me. Today my youngest was watching the 3D lens flair tut with me and when you got to the semicolon at the end of the expression, he said emphatically (with a 4 missing front teeth lisp)... "HE'S GOOD!! Did he go to school a lot?". I replied "He IS the school".

Anyway... seems your impressing even the youngest of audience and hopefully some future compositors.

Keep cookin'
9 years ago
MMM,, I have a problem whith this expression. Im importing a 3d camera form 3dMax whith MAX2AE.... the imported 3d camera must have the AUTOORIENTATION OFF.... and wen this option is active on any After Effect camera, the expression not work......

any idea??.. thanks man, you rally are the zen master of this stuff.

hugo, from Chile
tyrone the bamboozle
10 years ago
goood yall good gravy yall this is the fanatabulos i am likin it much okay bybey!
blark
10 years ago
thanks man. its really a cool tip.you folks have been helping me alot.
Jhon
10 years ago
Thank u Andrew! ;)
omid akbari
10 years ago
Thanks for the tip
The Rover
10 years ago
Great !

Can this somehow work with Advanced lightning?
jo
10 years ago
I've tested that trick after seeing the bump tutorial but for having much control of my flare i didn't use the classic lensflare fx but one from the genart's saphire wich allowed me to use the point of interest of my light to control the lenflares artefacts are moving.

So now I have a lensflare which follow exactly my light.
Kevin Lee
10 years ago
Thanks Brett Kdawg925@gmail.com Just love to learn those little tips.
Vinz
10 years ago
nice tips .. andrews better 2 experiment now with this new tips..
4apay
10 years ago
thnx a lot!
Brett Perry
10 years ago
Hi Kevin,
I can't remember where I saw the tip or tutorial, although I suspect it was from John Dickensons' Motionworks web site. If you're really interested, send me your e-mail address and I'll send you a project file for you to check out that will show more detail than I can describe here. Hey, us AE nuts gotta stay together.
Brett
spademax
10 years ago
very nice tip! thanks a lot
10 years ago
Thank you so much Andrew,
You always have something new and exciting to share with us. Im soon going to purchase action essentials 2, and thanks to you I will be creating awesome composites, with your elements I have ideas that probably no one has ever though of in my own twisted way which you encourage us to do as always. I really do appreciate everything you have done for us all.
Thanks Again.


-Brandon Lagenour
-Revolutions Designs
However
10 years ago
hey can you make a preset for anamorphic lens flares?
Matthew Sabia
10 years ago
Thanks that's really usefull ;)
10 years ago
could you transfer this to other plug ins like cc particle world and if soo what would you use as the "flare center".
Kevin Lee
10 years ago
Thanks Andrew for the tip.

Hey Brett, that sounds like a great tip. Is there somewhere I can learn that a bit more in depth?
Alex
10 years ago
Thanks Andrew, very useful tip
andi
10 years ago
Sometimes I really do worry about Andrew's Lens Flare fetish
Brett Perry
10 years ago
Thanks Andrew,
Just a quick note that I'm sure most people have already figured out. You can use this on other 2D effects as well. Use two 3D nulls and a layer with the "beam" effect applied and the above expression using connecting one null to the start point and one to the end point. Add a camera and move the nulls in 3D space and then rotate the camera - ahh the beam in 3D. I've used this trick with the center point of Trapcode's Shine on projects as well. GO AEing today.
Brett
anvir tahini
10 years ago
IS MAKES!!! IS NICE KRAMER YOU ROCKS !!!! DUDE!!!!!
Brad
10 years ago
That's certainly very cool. Thanks for the tip!

I wonder if AE CS5 will have real 3d lens flares? :D
10 years ago
Hi, thks so much for the tip, also for all the help...

PS: My regards to Sam, I feel sorry for him.

Js´ Andrew you have:
CRASH the guy, Throw it to the floor, Blast him, Stab him, Send it to God knows where, Put it into a fight, converted to some kind like a alien, disintegrated, blow him up, freeze the pour guy to death, bug him, make him almost one of the 10 terrorist most wanted… What else you going to do to the unfortunate human being called “Sam”….

Igor
highdefw
10 years ago
Nice tip. Thanks.
10 years ago
I've always wanted to know how to do that :D
Shavkat
10 years ago
thank you Sir
10 years ago
I remember seeing that before. Thanks for the refresh! :)
borysked
10 years ago
THX :D hope it will help me and someone else in future
UmairVFX
10 years ago
Hey Buddy nice tip.

but i must say here that you have already mention this expression in your BUMP map tutorial as well and i think your another tutorial too.


well here is another expression which do the same thing.
Thoeds
10 years ago
cold!
Anthony Breslin
10 years ago
Aww just did it there. Class!

Thankyou Andrew Kramer once again ha :)
10 years ago
I figured it'd be scaling the size to match the distance on that axis.
Anthony
10 years ago
Em andrew is this ment to replace the orb we made in the tutorial or add on top of it??

It looks class btw! :)
Jim
10 years ago
Good Tutorial Andrew !
10 years ago
Sweet, this should come in handy soon!
nivekb
10 years ago
nice tip thank you
10 years ago
The whole expressions thing is still a little over my head. Well Writing them that is.
jon
10 years ago
nice man! good stuff right there
Raymond
10 years ago
Huh, I really need to take some notes when I watch these things. Totally forgot about that particular expression...
jim hines
10 years ago
I'm digging this "written" quick tip things. Thanks.
10 years ago
Thank you!!! I've always wondered how to do this, and never could figure out how! You ROCK!
Joe
10 years ago
cool
jay
10 years ago
thx andrew.
Daniel
10 years ago
Thanks for the tip.
mike
10 years ago
nice... always somehting useful :-)

thank u
Kasra
10 years ago
thanks for the tip