SHADER IN AFTER EFFECTS

ANMOL KUMAR
4 min readAug 26, 2021
Banner

Main Objective

Make a pseudo Shader for objects in the after effects with minimum effort.
(Shader is originally a term from 3d softwares like blender, c4d, etc. where renderer calculate the appropriate amount of light, darkness and color on different parts of object according to lighting conditions)

Scene Setup

Let’s start with a simple scene. We have a ball with ‘inner shadow’ and ‘inner glow’ effects applied to have a decent 3d looking ball which is about to fall on the glowing wedge that is lying below in both cases.

Expectations are — The balls will glow a little from the part facing the wedge with that colors of the wedge

🙇🏻‍♂️ The Long method

Generally to get a glow of the wedge on the ball(i.e the reflection of the colors of wedge) we need to duplicate the ball layer and make a accurate mask on the duplicated layer.
and fill it with color of the glowing wedge!

The masked part on the duplicated ball will also follow the motion of original ball but, shape of mask will be same for every instant of time!

It’s time to grab those Bézier handles and animate it every other frame and of course tweak the keyframes in graph editor to make it look real.
mask shape w.r.t — the mask will expand as it gets closer to wedge and will collapse as the ball moves further away! that’s lot of work.

Major Drawbacks

In this scene the ball only made contact one time with the wedge, when bounces multiple times on the a glowing surface, mask need to be animated again and we can’t copy previous keyframes because mask path also preserves position w.r.t canvas, not w.r.t to original shape.

🤞🏻My Method

A Copy of that wedge is shifted toward the light source (top left corner in this case). Also the wedge is blurred and a subtle glow effect is applied!

This is where the Magic happens!

the ‘set matte’ effect on the extra wedge is applied. and the glowing wedge is only visible when ball overlaps it.

Whenever the ball is close to the wedge surface it’ll glow!

Order of effects also plays a important role here!

  • the first ‘set matte’ makes the extra wedge visible whenever ball overlaps it
  • then ‘Gaussian Blur’ blurs the visible part to smooth the edges. but it also causes the duplicated wedge to fall outside the ball
  • then the ‘set matte 2’ makes sure the blurred part is not falling outside ball and again brings all content of wedge to ball!
  • then a subtle glow followed by a little increment in exposure of light by help of ‘lumetri color’ effect

Impact

  • Overall time is reduced drastically as half of key framing work is gone now
    Highlights as well as shadows can be created using this method
  • I saved the order of effects as an preset to re-use it saving even more time, I only need to define layers in the ‘set matte’ effect. Rest is already done

--

--