-
Dynamic lensflare problem
Hi Guys
I trying to create an expression that dynamicly changes the brightness of a lensflare as it passes by the camera. The lensflare is attached, via an expression, to a 3D null object. The expression belov yields the desired result, but if the null object is directly behind the camera, the lensflare is rendered, which is not desired.
The lensflare layer is a 2D layer and gets its information from the null object “Child 2” and the “Camera 1”
This is what was added in the lensflare brightness property:
it works, but doesn’t shut the lensflare off when behind the camera.cam = thisComp.layer(“Camera 1”);
camP = cam.toWorld(cam.transform.position);c = thisComp.layer(“Child 2”);
cP= c.toWorld(c.transform.position);vec = cP-camP;
dist= length( vec );
dist = 100 – (dist*4)/100; //The adding and deviding was to creat a exponential scale in brightness.
This is what was added in the lensflare position property:
c=thisComp.layer(“Child 2”);
p=c.toComp(c.anchorPoint);The thought was that the camera would be animated, so I can’t just use the Z-axis as a referencepoint. I need a way to detect if the Null object “Child 2” is behind the camera, no matter what way the camera is pointing and where it positioned.
You guys have any suggestion?