How To align 3D layers perfectly in After Effects

August 11, 2009

Sometimes, when making 3D shapes in after effects, you just can’t get two layers to line up properly. Here is a trick I learned to make sure your edges always look like they are perfect.


  • Nice trick Nick, I never used that blend mode before. I once ran into the same problem, fixed it by putting a light inside the cube so you can’t see the nasty black lines (=shadow). You’re probably aware of the handy little script for instant 3d cubes the guys at AE Enhancers came up with:

  • Great tip Nick, FYI: Nab has some scripts that create 3D shapes and give you expression controls to be able to modify them easily after the fact.

  • just save my day ^^:) thx a lot

  • Great tip !
    But one thing which make me crazy is that when you export from “vanishing point” from Photoshop and import that in After effects, the edges are perfect AND in normal mode…

  • NICK,
    for 3 years now that problem has been ruining my comps.
    Awesome tip, keep them coming. Your site is now on my daily list.

  • I still have some tearing when motion Blur is applied. Any ideas on how to fix it?

  • For some reason, when I do the third side it is spaced a bit away from the other two sides (there’s a huuuge gap). Any idea as to what is going on there?

  • I love this little tips almost more then in depth tuts
    thanks for this and keep them coming

  • Great tip! That could have saved me tons of frustration over the past few years.

  • @Julie

    Does your comp or solid have non-square pixels?
    If so, that would throw the math off.

  • This tip helps solve a problem I’ve been having for awhile. Thanks for sharing the knowledge!!!

  • it bothered me at first (several years ago) but i got over it and embraced the “feature”. eventually i started doing stuff in zaxworks and c4d and stopped building 3d elements in AE to get around it. either way, thanks nick for the tip.

  • Here’s what’s going on:
    The issue is that the edges of the solids are anti-aliased—which means that their opacity falls of gradually. And the normal way of blending two layers with partial transparency is the way that they blend in real life. Consider that if one layer is 50% transparent, it’s letting 50% of the light through. Then the next layer that’s 50% lets 50% of the remainder of the light through, for a result of 25% getting through the set of layers as a whole.

    But when you’re building a 3D object from anti-aliased layers, you don’t want this real-world, normal blending. You don’t want opacity information to be calculated by multiplication; you want it to be calculated by addition. Hence Alpha Add.

    This is all explained in the “Blending mode reference” section of After Effects Help. Just look for the tip in the Alpha Add section:
    “Blending mode reference”

  • Great tip, as said would have saved a lot of pain over the years. Thanks!
    Todd, really appreciate your perspective and explanation.

  • Nice little tip mate.
    Great fix for that seam-line problem when all sides are the same colour.

    When the sides are different colours however… AE still seems to have issues. I find that this can be solved in most cases with an expression that makes the 3D layers that are facing away from the camera invisible, removing that hairline strip of colour caused by the back layer somehow showing through on the outer edges.

    if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

    (Apply this to the layer opacity)

  • i like the adobe guy he knows the program inside n out.. genius, neway you da man nick nice lil tipsy there, how bout this for a new tutorial…I see you a lot about 3D in Cinema 4D how bout some more tips/tuts bout incorporating that with AE

  • Nick,
    Very cool. That would have helped with [Un]Boxed.
    So, I have a question, do you have any advice for the issue of rotating around a “2.5D” environment and keeping the camera from “Flipping” 180 degrees? It make things a little confusing and annoying to work with.

    thanks again!

  • very cool, how are you liking AE CS4?

  • This is such a great tip.
    Believe it or not I was just starting a new project that involves cubes in the animation, so the timing was perfect.
    Thank you so much!

  • Nice Tip! Thank you big Monkey:)

  • Nice tip Nick! However, as seen at 3:27, when you create the light, there is still a seam on the outside (one the left) of the cube! Is there a way to fix that?

  • This was a nasty one ! THX

  • Hey, Nick.
    What about a forum here on your site? Or this has been mention before and been declined as well πŸ™‚
    As we see you have many viewers and they can share much more information in a more suitable environment.

    Also thanks for the tuts. really glad to see them coming.


  • nice tip! i always wasted time trying to nudge them around.

  • Yeah or if you to lazy make a cube yourself (or/and need a plugin for more complex 3D jobs) and $199 left to spend, try Red Giant’s PlaceSpace (

  • Great tip, that will save me a lot of headaches.


  • I do cubes in AE all time!! thanks for the tip !!

  • wow, I had that problem for so long and I could never find a solution thx πŸ™‚

  • Thanks. That’s just brilliant.

  • How did you learn CSS, what kind of books would you recommend to learn Design for WordPress ?

  • Very useful tip, thanks a lot!

  • Hey, Nick!!!
    I am in an heavy Project and without your tip i never get your stuff out!! My example wat that:

    Thank you really much!!! Thats fantasic it works also for mates! So thank you anyway!!!! Please Reply.


  • very nice tip, thanks. but it doesn’t work for me with lighting … =(


    also when working with images/comps instead of AE solids it’s glitchy without lighting aswell, what am I doing wrong?

  • I lose so much time to adjust those edges…Thx you very much for this tuto and all the work you’re sharing here.

  • Heiii Gorilla. Ok , you save me all time with your tutorial.
    Just a question. Ok, I solve this with Alpha Add . But if I want use also another blend mode like for example multiply for texturing my layer .. what I can do?
    thanK you very GORILLAZ

  • Great tutorial mr gorilla πŸ™‚ thanks!

    how about a perfect alignment tutorial for such shapes are pyramids? πŸ˜€

  • Use a square pixel comp, and it will get rid of the edge…everything is measured in pixels in AE, so using square pixels will make a seamless connection

  • Hello,

    check out my projecfile!
    I think i found a useful way to fix the antialaising problem in AE when using lights in 3D space.

    1. the sides not facing the camera are scaling .5% smaller (prevents the reflection problem)
    2. using ALPHA ADD (fixes a part of the AE antialaising problem)
    3. using all sides two times: one for the visible cube – the other (position-1) to cover the inner space

    this workaround works fine with lights and cameras in 3D space!
    The only problems is that you can not precompose the cube because of the expressions to scale down the not faceing sides of the cube
    (please download file via an Downloadmanager)

  • Hi Nick,
    thanks for your cool web-AE-Lessons!
    Iam from Germany, learning to work AE.Sorry for my bad english;-)
    I did this 3D CUBE with Alpha Add – and it looks better – but not perfekt.
    There are still strange lines at the corner (less but still there) Is it a problem with the settings?

  • Shakin’ freshness, there man! Thank you.

  • great stuff mate! this one is a life saver. in search for it for a while (like yoruself) thanx for this tip.

  • Thanks for the great Tutorials.

    However the alpha add does not work for me. I have searched the web from one end to the other
    for an answer. No matter what I try those pesky gaps remain. Even with square pixels selected.

    Please help

  • Holy– you just saved my life. I’ve struggled with this for years!

  • I came across your tip and thought it would help solve my problem, but it seems not. Either that, or I’m doing something wrong. πŸ™‚

    I’ve created a standard 3D cube in AE (CS5.5) in the same way you demonstrated, which looks fine in a normal lit environment, but if I throw a light onto it, it looks like some of the edges are not aligned correctly (although I’m CERTAIN they are!). I’ve applied Alpha Add to the 6 layers as you advised, but this doesn’t fix my problem. Perhaps it’s something else that’s causing it?

    Here’s a cropped screen cap of the problem I’m getting:

    As you can see, at the rear of the cube, the light from the AE spotlight is showing up what appears to be a misaligned layer.

    I created a no frills very basic cube and light AE project (697k) where you can check exactly how I set the cube up. You can download it here:

    What am I doing wrong?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.