LIBRARY: Tutorials Reviews Interviews Editorials Features Business Authors RSS Feed

Layered Earth Effect

Layered Earth Effect
A CreativeCOW.net Adobe After Effects Tutorial
Layered Earth

Mylenium
Mylenium
http://www.mylenium.de
Germany

©Creativecow.net. All rights are reserved.
Article Focus:
We are going to build a layered, onion-skin type model of the earth revealing its internal structure. The goal is to create an illustration-like setup that is controlled via expressions and can visually hold up to things you can find in scientific books. Other scientific and statistical data can also easily be illustrated by modifying this setup. Most importantly you will learn something about structuring your layers and compositions in a way that will allow you to manipulate transparencies and mattes without destroying the illusion of 3D.


Step 1: The perfect Sphere

Unlike in most of my other tutorials this time we will start out with defining the look of the "Blue Marble" and its internal layers. For this we are going to use the CC Sphere effect that comes free with After Effects 6.5 Professional. If you are not using this version (e.g. educational versions don't contain the Cycore Classics) you can download a demo version of them at www.cycorefx.com or use other plugins such as Boris Continuum Complete. You can also build your fake sphere using multiple instances of the Circle effect. Let's get to work.

I admit that the headline may be incorrect or misleading - by definition a perfect sphere is a surface where every point has the same distance in 3D space to a center point. My main concern however is the look of this sphere and in this respect the default CC Sphere settings are less than perfect. Actually we are even going to use multiple layers with this effect to build something that is more reminiscent of a sphere as it appears in the real world.

Our perception of 3D space is largely dependent on our perception of light and how it is scattered, reflected and refracted by surfaces and materials. In computer graphics three simplified light components are commonly used (real light of course is much more complex). Let me explain them in short and heavily simplified terms:


Ambient light

In nature there is no such thing as complete darkness or more specifically complete lack of light. Everything either emits light or reflects at least the tiniest bit of light. This may be on a part of the spectrum that is invisible to human eyes, but it's there anyway. Since this light is permanently reflected and scattered even by such tiny things as air molecules, it is assumed as having no discernible direction but rather "filling" our surrounding environment, illuminating everything evenly. If this light was the only light, everything would appear as uniformly colored flat objects. So, e.g. a black cube would not be black in technical/ physical terms, but rather a very, very dark grey.


Diffuse light

Similar to the ambient light this type of light is all around us. The big difference is that it has a direction and thus makes it possible for us to perceive objects as three-dimensional and make guesses about the source of the light - a surface facing away from a light source receives less diffuse light and appears darker. Also it is the actual light that defines a objects color as it interacts with light.

Specular Light

This light can only be seen from certain angles. More specifically the angle of incidence on the surface must match that of the line of sight. The further away it is from that ideal, the less pronounced this effect becomes. For instance highlights on curved surfaces can be described this way. It is directly dependent from the smoothness/ roughness of a surface (i.e. its microscopic structure).

Now if you look under the Shading options of the CC Sphere effect, you can find all those components. Try to change their values and get a feel for what each slider does. After a while you may find some settings that look good, but it will still not feel "real". We are going to change that.

Create a new composition and add 3 solids to it. Name them Ambient Light, Diffuse Light and Specular Light respectively. Put Ambient Light at the bottom of the stack and the other two layers on top of it. Make sure the layer mode is set to Add on the upper layers. It should look like this:



Apply the CC Sphere effect to all three layers. Leave most parameters untouched for the time being and twirl down Light and Shading effect controls. Focus on the following parameters only: Light Intensity, Light Color, Ambient, Diffuse, Specular and Roughness. Adjust the settings for each layer as follows:

Ambient Light

Light Intensity:
Light Color
:
Light Direction:

Ambient:
Diffuse:
Specular:
Roughness:
100
Red(16), Green(26), Blue(90)
75
(default is -85 degrees plus 180 degrees makes 75 degrees)
10
100
10
0.05


Diffuse Light

Light Intensity:
Light Color
:
Ambient:
Diffuse:
Specular:
Roughness:
49
Red(48), Green(108), Blue(182)
0
100
56
0.176


Specular Light

Light Intensity:
Light Color
:
Ambient:
Diffuse:
Specular:
Roughness:
100
Red(255), Green(55), Blue(55)
0
100
67
0.128

With those values in place, your sphere should look like this:



We will add one more layer. This does not represent any physical component, but will help to make our sphere more pronounced. For this we are going to use an implementation weakness in the CC Sphere effect to our advantage.

Rim Light

Light Intensity:
Light Color
:
Light Height:
Ambient:
Diffuse:
Specular:
Roughness:
100
Red(51), Green(160), Blue(219)
-100

0
100
56
0.176


The result of this little trick can be seen here (notice the bright "halo" at the edges).




This is much more eye pleasing and feels more real than what you can achieve with just a single instance of CC Sphere. You gain a lot of control because you can adjust the colors and intensity values as needed. However, you may want to facilitate this to some degree, so we are going to add a few simple expressions in the next step.


Step 2: Guiding Light

What we just created is later going to be the Crust, Earth's outermost shell and the part we are actually living on. So go ahead and rename your composition to Crust pre and add the Crust designation also to your layers. It is going to act as a template comp for all other layers. But first things first. Let's apply expressions.

Depending on the design you are going to incorporate your Earth, the day and nighttimes you may want to represent etc. you may want to adjust the position of the light. This can easily be done by connecting the Light Height and Light Direction properties. But careful, my friend, didn't we say we are going to add more compositions later? Yes, we did. So it would be stupid to add controls inside our Crust pre composition. What we need instead is a global composition that holds everything together. And guess what: Earth Main is the name of this new composition! Drop Crust pre into this composition and add a Null layer or invisible Solid layer named Controller. Add a Slider expression control to it and rename it and Sun Height. Also add an Angle expression control and name it Sun Direction. Now go back into Crust pre and apply these expressions:

Crust Ambient Light - Light Height
[-comp("Earth Main").layer("Controller").effect("Sun Height")("Slider")]
Crust Ambient Light - Light Direction
[comp("Earth Main").layer("Controller").effect("Sun Direction")("Angle")+180]
Crust Diffuse Light - Light Height
[comp("Earth Main").layer("Controller").effect("Sun Height")("Slider")+45]
Crust Diffuse Light - Light Direction
[comp("Earth Main").layer("Controller").effect("Sun Direction")("Angle")]
Crust Highlight - Light Height
[comp("Earth Main").layer("Controller").effect("Sun Height")("Slider")]
Crust Highlight - Light Direction
[comp("Earth Main").layer("Controller").effect("Sun Direction")("Angle")]
Go back to the Earth Main composition and change the values on your custom expression controls. Everything should move in unison and allow you to easily manipulate from where your light hits your Earth. You may wire more parameters to custom controls (which we are going to do later on anyway), but don't overdo. Connecting everything would be inefficient and counter-productive at this point.


Step 3: Always the Sun, always...

This is an optional step, but since we were fiddling with our sun anyway, this is perhaps the most appropriate place to insert this.

In an earlier tutorial of mine we created a stylized sun from After Effects layers. The tutorial can be found here. We are now going to use this setup and modify it for our purposes. The main differences are:
  • We are not using any perspective skewing, so we only have a center.
  • We are using extra sliders to control the length and breadth of our beams.
  • We are animating the beams in a rotating and undulating pattern.


Import the sun project into our current project and then open the composition Sun. Delete the layer Target and Controller. You should get some error messages. Don't worry, we're going to fix everything. Also delete all instances of Beam in the Sun composition except for one. Open the Beam comp and adjust the shape to something pleasing. Make sure you also change the color to something other than red. Yellow is most useful for what we are trying to do. Go back to the Sun comp and add two more sliders to the Center layer. Name them Beam Thickness and Beam Length. Apply the following modified expressions to the Beam layer:

Position

center_X=thisComp.layer("Center").position[0];
center_Y=thisComp.layer("Center").position[1]; radius=thisComp.layer("Center").effect("Radius").param("Slider"); angle=Math.PI*2/(this_comp.num_layers-1)*(index-1)+time/3; position_X=center_X+Math.sin(angle)*radius; position_Y=center_Y+Math.cos(angle)*radius; [position_X,position_Y]
Rotation
diffX=position[0]-thisComp.layer("Center").position[0];
diffY=position[1]-thisComp.layer("Center").position[1];
angle=radiansToDegrees(Math.atan2(diffY,diffX)); [angle]
Scale
seedRandom(index,true);
offset=random(-2,2); X=thisComp.layer("Center").effect("Beam Length")("Slider")+Math.sin(radiansToDegrees(offset+time/10));
Y=thisComp.layer("Center").effect("Beam Thickness")("Slider"); [X,Y]
As in the original sun tutorial all that remains to do is clone the Beam layer a bunch of times, adjust a few parameters and maybe add some Glow effect and you should have a happy little sun like this:



That's not bad, but we are going to do just one thing more. Drag your Sun comp into Earth Main and add a Light, Null layer or invisible Solid in 3D mode to this comp that will act as a placeholder for the sun. Also make sure you add another slider to your Controller layer and name it Sun Distance. Use the following expression for the light's position:
distance=thisComp.layer("Controller").effect("Sun Distance")("Slider");
direction_Y=degreesToRadians(thisComp.layer("Controller").effect("Sun Direction")("Angle")+180);
direction_Z=degreesToRadians(thisComp.layer("Controller").effect("Sun Height")("Slider"))+180; X=thisComp.width/2-Math.sin(direction_Y)*distance;
Y=thisComp.width/2+Math.cos(direction_Y)*distance;
Z=thisComp.width/2+Math.cos(direction_Z)*distance; [X,Y,Z]
On the actual sun layer itself apply the following expression to the position:
sun=thisComp.layer("Sun Light");
sun_position=sun.toComp([0,0,0]);

[sun_position[0],sun_position[1]]
This will properly place your sun where your light source is and if you animate the sun light parameters, your sun will even orbit your Earth. You can use the same expression on the Flare Center property of the Lens Flare effect if you need this kind of effect.


Step 4: Cutting the Pie

In order to reveal the insides of our Earth, we need to cut it up. If the CC Sphere offered something like a sweep option ( = how complete the sphere is around its circumference), we could easily create hemispheres, quarters or even tiny slices. Unfortunately for us, it does not. So there is even more work ahead of us.

Since we cannot really cut up our sphere, we will at least create the illusion of this process (and as you will find out, it works just as well). For this we need some 3D layers, which we are going to place on top of the layers that define our actual sphere. Create a new solid of 500 by 500 pixels size and call it Crust Right. Place the anchor point of this layer at its leftmost edge and at half the height of the layer (0,250). Turn on the 3D layer switch. Make sure the layer is positioned exactly in the center of our composition. I used simple expressions for all this positioning, so I wouldn't accidentally misalign everything. this is not a prerequisite and you do not need to use expressions. Just be careful not to mess things up or it will ruin your look. Apply at least two instances of the Circle effect to this solid. The first instance will do the actual covering up of the sphere below and provide the canvas (hence I called it Underlay), the second will create the thin edge that represents the Crust. The center of those circles must be in the same position at the left edge as the anchor point. This will effectively create a semi-circle.

Before we proceed, we need to create a few more sliders on the Controller layer in our Earth Main comp. This could be done at a later point, but if we do it now, it will save us some work and spare us some confusion. The sliders we need are Earth Radius (you can call it also Crust Radius, which is the thing it actually defines), Crust Sweep and one called Fake Shadow Density. Now go back into your Crust composition and find all instances where you need to adjust the radius of your spheres and Circles. Use simple pickwhip expressions so the line reads
[comp("Earth Main").layer("Controller").effect("Earth Radius")("Slider")]
I elected to not link other parameters since it is easy enough to adjust them manually, but you may do so if you feel the need for that. You have now a template layer which we can use. Clone Crust Right two times. for clearness I chose to rename the resulting layers to Crust Sweep and Crust Right Matte. Now add an expression to the Y-rotation that links it to the slider in our Earth Main composition on both layers. It should read like this:
[comp("Earth Main").layer("Controller").effect("Crust Sweep")("Slider")]
Crust Right Matte should be placed directly above Crust Right. As the name implies, it is supposed to act as a matte layer. So select Crust Right and choose Crust Right Matte as its Inverted Alpha matte layer. This will create a crescent shape cutout, fully reveal or hide the layer depending on the sweep angle. Play with different values to see the effect. Whilst doing this, that our Crust Sweep layer does not behave as expected. It is visible all the time and will ruin our illusion. It's nothing, that can't be cured, though. The trick is to completely hide it ( = make its opacity 0) during the first 90 degrees of sweep. Our expression does just that.
sweep=comp("Earth Main").layer("Controller").effect("Crust Sweep")("Slider");

if(sweep <= -90){100}
else(0)
Read it like this: If the sweep angle is smaller than - 90 degrees, the layer shall be visible, if the angle is between -89,999 and 0 degrees, must not be seen. The last thing we do is apply a Brightness & Contrast effect and link it to our Fake Shadow Density using this code
-comp("Earth Main").layer("Controller").effect("Fake Shadow Intensity")("Slider")
This will make our rotating layer darker then the static layer and further improve the illusion of 3D. We have to take care of one more issue. If you look closely and use the Preview transparency option (the little checkerboard at the bottom of the composition window), you will see an ugly black seam. this is because we used so many layers and their anti-aliased edges add up. To get rid of this seam, we will simply at an layer at the very top of our composition that will cut away the unnecessary parts. The radius should be linked just like on the other layers but made smaller by subtracting 2 pixels. Then all that you need to do is set the layer mode to Stencil Alpha and everything should look fine. The layer order and the result are illustrated in the images.






With all this in place, we have now a composition that we can use as a template for the remaining 3 layers (Mantle, Outer Core, Inner Core). You can simply clone the composition, create new sliders, rename everything and replace the references in the expressions.


Step 5: Stacked Alpha Conundrum

Admittedly, this next step somewhat escapes logic. One would think that it is enough to stack our sub-compositions in the order they are revealed, but the exact opposite is true. Funnily, using the (seemingly) wrong layer order is the only way to solve this problem, as you can see in the image.




The basic setup is the same as in the step before sans the spheres. Our intention is to create a luma matte based on the same principles. Since only the inner layers need to be taken care of, only three of those are needed. The logic is as follows:

The Mantle is affected by the Crust, so the matte for the Mantle must refer to the Crust. The Outer Core is affected by the Mantle, so its matte- yes, you guessed it - must link to the Mantle. The Inner Core... - well, no need to explain, is there?

So go ahead and clone your Crust pre composition that you created in the above step and rename the duplicate to Mantle Sweep Matte. Strip all the layers with the CC Sphere effect, Crust Right and the topmost Cutout layer. Clone the Crust Sweep layer one more time. At the bottom of the composition add a white solid that only covers the right half of the comp. Name it Filler or something similarly creative ;-). Now stack the layers in this order:



Layer 3 acts as a Inverted Alpha matte for layer for and layer 1 is an Alpha matte for Layer 2. Since we created our composition by cloning another one, all our expressions are still intact. This is great and saves us a lot of work. We need some minor adjustments, though. First we need to get rid of all color by adjusting our Circle effects properly. Everything should be a clean B&W image that can be used for a luma matte. Also we cloned our Crust Sweep layer while it had our conditional opacity expression attached. this is no good. It now gets in the way on layer 3, so get rid of it but leave it intact on layer 2. If everything went right, your comp will now look like this



...or this (with a different sweep angle)



You've almost made it! Yes, all you need to do is painstakingly repeat the steps for all your components and then bring them together in your Earth Main composition. Once that is done, you can lean back, play around with your settings and enjoy the thing.


Step 6: Refining the Look

Even an already good thing can be improved. In case of our Earth, there are a few simple improvements you can apply. Perhaps the easiest is giving it some more realism by adding a map onto the surface. You can easily find such maps e.g. at NASA's Blue Marble project. Add them as a separate instance of the CC Sphere effect inside your Crust pre composition.

Another thing is adding more structure and motion to the inner layers. I created some Magma that moves. For this all you need is some moving Fractal Noise. Add to that Colorama or Tint and then transform it to a circular shape using the Polar Coordinates effect. You may need to create those effects in another sub-composition to maintain a clean project structure.

The outcome of all your efforts could be something like this:




Enjoy and feel free to ask your questions regarding this tutorial in the After Effects forum at Creativecow.net



Please visit our forums at Creativecow.net if you found this page from a direct link.



Related Articles / Tutorials:
Adobe After Effects
Imagineer mocha Pro 5 Plug-In for Adobe: An In Depth Review

Imagineer mocha Pro 5 Plug-In for Adobe: An In Depth Review

Imagineer mocha Pro 5 Plug-in for Adobe brings all the amazing features of the professional version of the mocha Planar Tracker directly into After Effects and Premiere Pro in the form of a plugin. In this in-depth review, After Effects tutorial guru Tobias Gleissenberger of Surfaced Studio will show you what you can do with this new plug-in, and discuss what he likes and doesn't like about the new update.

Tutorial
Tobias Gleissenberger
Adobe After Effects
After Effects 2015.3 - My Favorite Features

After Effects 2015.3 - My Favorite Features

Learn why you should upgrade to After Effects CC 2015.3 - 13.8.1 - a close and detailed look at the latest release of After Effects (August 2016). Roei Tzoref will be focusing on his favorite features that set this release apart from previous versions: Performance, Queue in AME, Lumetri Color new features, and more.

Tutorial
Roei Tzoref
Adobe After Effects
Advanced Masking in Adobe After Effects

Advanced Masking in Adobe After Effects

Some of the coolest stuff you can do inside of Adobe After Effects is only possible once you unlock the power of masks. Join After Effects whiz Tobias Gleissenberger of Surfaced Studio to learn about mask animation and interpolation, using the variable width feathering tool, managing mask modes and ordering, and more.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Fixing Common After Effects Problems and Mistakes

Fixing Common After Effects Problems and Mistakes

Got problems using Adobe After Effects? Exported files too large, Expressions not working, mixing shapes and makes, modes/switches, selecting previews for layers vs. comps - Surfaced Studio's Tobias Gleissenberger shows you fast fixes for these and more!

Tutorial
Tobias Gleissenberger
Adobe After Effects
mocha AE Planar Tracker for Absolute Beginners

mocha AE Planar Tracker for Absolute Beginners

Want to learn how to create advanced visual effects? Learn how to use mocha AE to track your shot and add advanced visual effects to live action footage inside Adobe After Effects. mocha can help you track shots that would be hard to track using traditional 2D point or feature trackers because it is a PLANAR TRACKER. A planar tracker uses planes and textures to track as opposed to points or groups of pixels. This allows the tracker to stay on track even if your shot contains motion blur or a very shallow depth of field. mocha AE comes included with Adobe After Effects and is available since CS3 and there is no reason for you not to use this awesome tool to make it easier for you to track your shot, replace screens or rotoscope!

Tutorial
Tobias Gleissenberger
Adobe After Effects
How to Make After Effects Faster with Proxies

How to Make After Effects Faster with Proxies

Learn how to make Adobe After Effects faster by using PROXIES! A proxy is a placeholder that stands in place for a very large video file or image sequence in your project. You can easily create proxies for the large source files that you are using and After Effects will automatically link them to the item in your project panel.

Tutorial
Tobias Gleissenberger
Adobe After Effects
Stabilize & Smooth: mocha 5 Plug-in for Adobe & Avid

Stabilize & Smooth: mocha 5 Plug-in for Adobe & Avid

Imagineer Systems and Boris FX product specialist Mary Poplin shows you how to stabilize with the new mocha Pro 5 plug-in inside of Avid Media Composer, Adobe Premiere Pro and After Effects. This tutorial covers artistic stabilization, such as smoothing out camera movements or stabilizing around moving objects, completely locking down shots, and automatically replacing edge fill on planar backgrounds.

Tutorial
Mary Poplin
Adobe After Effects
Adobe After Effects Puppet Tool

Adobe After Effects Puppet Tool

Become a puppet master by learning how to use the Puppet Tool in Adobe After Effects! This intermediate-level tutorial from After Effects guru Tobias will show you how the Puppet Tool allows you to add joints and animations to bring life to any static image!

Tutorial
Tobias Gleissenberger
Adobe After Effects
How to Spawn A Clone in Adobe After Effects

How to Spawn A Clone in Adobe After Effects

Want to learn how to create a cool clone spawn effect in Adobe After Effects? Follow along with After Effects whiz Tobias from Surfaced Studio in this exciting new visual effects tutorial that combines green screen using Keylight, CC Vector Blur, the Liquefy Effect, CC Particle World, and much more, delivered in Tobias' inimitable style!

Tutorial
Tobias Gleissenberger
Adobe After Effects
Creating A Flame on Your Finger with After Effects

Creating A Flame on Your Finger with After Effects

It is easy to do some motion tracking and attach a basic stock footage element of fire onto your hands, but there is a little bit of work involved if you actually want to make it look good. In this intermediate tutorial by After Effects expert Tobias, you'll see how to use a fire stock footage element to set your thumb on fire! There are lots of useful tricks for null objects, expressions, and more in this tutorial that will help you create all sorts of other cool visual effects -- or set even more things on fire!

Tutorial
Tobias Gleissenberger
MORE
© 2016 CreativeCOW.net All Rights Reserved
[TOP]