How To align 3D layers perfectly in After Effects

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.

Signup for the newsletter.

Updates about once a week. Deals on new products. Not spammy. Whats not to love?

70 people have commented on this post. You should too!

  1. Hein says:

    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: http://aenhancers.com/viewtopic.php?t=194

  2. 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. http://aescripts.com/create3dshapes/

  3. stephane says:

    just save my day ^^:) thx a lot

  4. Vincent BOUDIER says:

    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…

  5. Jason says:

    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.

  6. Jason says:

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

  7. Julie says:

    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?

  8. mike says:

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

  9. Joe Clay says:

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

  10. William says:

    @Julie

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

  11. Dave Smith says:

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

  12. Jason says:

    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.

  13. Todd Kopriva says:

    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”

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

  15. Matt says:

    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)

  16. Jordan says:

    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

  17. 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!

  18. ScottCorey says:

    very cool, how are you liking AE CS4?

  19. Doru says:

    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!

  20. illd says:

    Nice Tip! Thank you big Monkey:)

  21. Baldur Helgason says:

    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?

  22. Olive says:

    This was a nasty one ! THX

  23. Bran says:

    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.

    Greetz,
    Bran

  24. Andy says:

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

  25. Jakob says:

    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 (http://www.redgiantsoftware.com/products/categories/motion-graphics/planespace/features/)

  26. Martin says:

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

    Thanks!

  27. Anibal says:

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

  28. Giovanni says:

    wow, I had that problem for so long and I could never find a solution thx :)

  29. Thanks. That’s just brilliant.

  30. Maxime says:

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

  31. Myaka says:

    Very useful tip, thanks a lot!

  32. Matthias says:

    Hey, Nick!!!
    I am in an heavy Project and without your tip i never get your stuff out!! My example wat that: http://s7.directupload.net/images/090818/epft8ads.png

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

    Matthias!

  33. sam says:

    brilliant!

  34. mizwo says:

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

    see: http://www.dumpt.com/img/viewer.php?file=3mghvmehbuuaztx0uxv8.jpg

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

  35. geo says:

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

  36. gianfranco says:

    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

  37. oliver sin says:

    Great tutorial mr gorilla :) thanks!

    how about a perfect alignment tutorial for such shapes are pyramids? :D

  38. Mlap says:

    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

  39. Pingback: 3D Cube « Professor DJ

  40. FrameArt.tv says:

    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

    http://www.frameart.tv/Download/AE/Cube3D.aep
    (please download file via an Downloadmanager)

  41. Chris says:

    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?

  42. Shakin’ freshness, there man! Thank you.

  43. dorian natan says:

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

  44. Bryan Edwards says:

    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

  45. Pingback: Graphic Tuts | How To align 3D layers perfectly in After Effects – GreyScaleGorilla

  46. Pingback: cgiant » Blog Archive » How To align 3D layers perfectly in After Effects

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

  48. Mike says:

    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: http://tinyurl.com/6vlfzpu

    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: homepage.ntlworld.com/mike1962/cube.zip

    What am I doing wrong?

  49. Pingback: How To align 3D layers perfectly in After Effects | greyscalegorilla/blog » 3d

Comment Rules: I love helpful comments. We don't all have to be friends or agree, but we do have to be nice. Criticism is fine, but rude comments will be deleted. Use your real name and don't be spammy. Have fun and thanks for adding to the conversation!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>