-
Using sampleImage to drive CG render passes
Hey everyone!
So we’re building a CG theater for use in VR, and instead of using the movie screen to light the geometry in the scene (requiring us to render out every single frame of a movie to get interactive lighting on the CG assets) I had an idea to use something like sampleImage to drive the different render passes (diffuse, glossy, etc), which means all we’d have to do is render out the theater one, and then let the movie itself drive the lighting in AE.
I found a post here: https://markos.co.nz/2012/05/after-effects-expression-use-the-luminance-of-one-layer-to-drive-another-layer/ which uses the expression pasted below. But it sounds like sampleImage might take a long time to process for each frame of the film, or may be too robust for our more simple simulation.
So I’m wondering… do you all know of a good expression set I could use to sample the brightness & color of the movie file and then use it to drive the brightness & color of the combined render passes? Or perhaps expressions aren’t needed at all?
Thanks so much for your thoughts! Appreciate you guys.
exposure = effect("Exposure")(3);
multiplier = 2;driverLayer = thisComp.layer("MuzzleFlash");
samplePoint = [0,0];
sampleSize = [1280,720];lightnessSample = driverLayer.sampleImage(samplePoint,sampleSize);
driverLightness = rgbToHsl(lightnessSample)[2];exposure = driverLightness * multiplier;