Greyscalegorilla.com

X-PARTICLES: millions of particles, fast render times

How To align 3D layers perfectly in After Effects 73 Comments


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.

HDRI Studio Pack
Texture Kit Pro

Comment Rules

This is a friendly community. Please treat everyone with respect. We don't all have to agree, but we do have to be nice. Criticism is fine, but rude comments and name calling will be deleted. Use your real name and don't be spammy. Thanks for adding to the conversation.

73 Comments

  1. 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

    Reply
  2. Vincent BOUDIER

    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…

    Reply
  3. Jason

    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.

    Reply
  4. Jason

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

    Reply
    • Morten K Christensen

      Precomp it and add CC force motion blur, or if u have it, “RSM Blur”

      - Great tip nick!

      Morten

      Reply
  5. Julie

    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?

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

    Reply
  7. @Julie

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

    Reply
    • Julie

      Yup that was it! It had gotten knocked to another setting for some reason. Thank you!!

      Reply
    • Stinger

      Thanks that saved my day, i just couldn’t figure the ## out why it wouldn’t match up ;)

      Reply
  8. 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.

    Reply
  9. 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”

    Reply
    • I always had a feeling that this was the case, but I never knew a way around it. Thanks for the additional information.

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

    Reply
  11. 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)

    Reply
    • Zuke

      Yea! very cool man. Works excelent with sprites. Thanks!

      Reply
    • Fred Sprinkle

      Thanks Matt!

      That expression is a lifesaver (in the digital sense).

      Reply
  12. Jordan

    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

    Reply
  13. 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!

    Reply
  14. 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!

    Reply
  15. Baldur Helgason

    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?

    Reply
    • I noticed that too Baldur, I wondered if it had to do with screen settings and not actual render. He is working at 50% scale but 100% render, you typically get rough edges if those two percentages don’t match.

      Reply
    • hmmm, did you ever find a solution Baldur? im getting the same results when adding a light to cube, seams still there. (CS4)

      Reply
  16. 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

    Reply
      • You got a “Push the Button” website, might as well have a GSG forum.

        Come on…everyone else is doin it! You wanna look cool, dont ya?

        Reply
        • I really like that forum MMC. Any idea on if that is handmade or if it’s something that I could download?

          Reply
        • I’m pretty sure it’s custom. It was overhauled a couple years ago, used to be Newstoday. There has to be something kind of similar out there for download though.

          Reply
  17. Martin

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

    Thanks!

    Reply
  18. Giovanni

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

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

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

    Reply
  21. gianfranco

    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

    Reply
  22. oliver sin

    Great tutorial mr gorilla :) thanks!

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

    Reply
  23. 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

    Reply
  24. 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)

    Reply
  25. Chris

    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?

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

    Reply
  27. Bryan Edwards

    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

    Reply
  28. 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?

    Reply

Leave a Reply

Comment Rules

This is a friendly community. Please treat everyone with respect. We don't all have to agree, but we do have to be nice. Criticism is fine, but rude comments and name calling will be deleted. Use your real name and don't be spammy. Thanks for adding to the conversation.