-
atmospheric fade expression
hey,
i’ve been working on an expression to create a styled atmospheric fade in after effects 3d. based on dan’s light falloff expression i retooled it to give a percentage value based on the distance between an object and the camera using the zoom length as the falloff point. i then use a linear interpolation so i can pump the percent value into any variable, in this case an individual levels input white point.
i was hacking the script in a the rotation variable in a null layer and was getting the values i was looking for, a value between 144 and 255.
when i copied and pasted the script into levels input white point it gave me a static 36720.
which i have no idea how that happened.
can someone help me clean up this expression?
decay = .05;
noFalloff = thisComp.layer(“Camera 1”).cameraOption.zoom;L = thisComp.layer(“Camera 1”);
d = length(L.transform.position,transform.position);
if (d < noFalloff){ x = 0; }else{ x = Math.exp((d - noFalloff)*decay); } if (x > 100){
100;
}else{
x;
}
linear(x, 0, 100, 144, 255)you’ll need a 3d layer and a camera called “Camera 1” default stuff here.
thanks,
chris d-_-b