9 Replies Latest reply on Nov 16, 2011 12:46 AM by mikedavis57

    Stereoscopic distortion or keystoning in AFX CS5.5




      If anyone could give me an answer to this, they'd win a whole loads of gold stars.


      I'm using after effects CS5.5 to create a 3D scene, set up a camera, turn it into a stereoscopic rig and then render out two separate eyes for re-combining as stereo later.


      Should be pretty basic.


      I've made the scene, everything's in place.  Camera's there, it's a stereo rig.  All fine.




      The output looks weird.  By this I mean the entire scene bowls out from the centre, it's like you're looking at a concave surface. So a straight line positioned on screen plane, of say a graphic, going across the image appears to now warp at the centre.  I've set up test characters across the screen, like a grid, and the effect is clearly there, no matter what parameters you have the separation and convergence set to.  The only way I can remove it is zero separation.


      I initially thought it was caused by artificial lens distortion applied by AE to replicate, e.g. the 35mm lens.  But now I reckon it's due to the exaggerated keystoning effect caused by pointing the 2 cameras at different angles to the centre.


      Is there any way of turning this effect off, or changing something to effectively rmove it?


      I've tried using a much larger focal length, so the lens should be much flatter, but the problem there is all the elements need to be ridiculously far apart to work as 3D.  I thought I'd cracked it when I switched to having 2 parallel cameras (i.e. no convergence on the rig), and using the '3D Glasses' effect to slide the L/R eyes together - the equivalent of shooting parallel and 'fixing in post'.  Problem with that, though, is a) it clips the output picture left and right, no amount of re-sizing fixes it, and b) it's useless if you need the separate left and right eye renders, as it doesn't affect them at all.


      Please, someone tell me how to get rid of this thuddingly annoying effect, before I lodge my monitor down a drain.


      Thanks immensely


        • 1. Re: Stereoscopic distortion or keystoning in AFX CS5.5
          Rick Gerard Adobe Community Professional & MVP

          I've not seen barrel distortion. Do you have convergence set up properly? The defaults are fairly close but convergence must be set up so that you're establishing a plane for the screen.


          The usual procedure is to set up a comp with or without a camera, then add the stereo rig, then do your animation in the main comp you started with. The 3D rig setup will add a left and right camera to the main comp. You can delete these. They are marked with something like "For educational use only."


          When you are ready for output you set convergence to establish the screen plane distance in the scene. I usually do this by scrolling through the main comp to a point where I know I want an element to be positioned visually in the same plane as the screen. I then go to the Stereo 3D comp and set convergence so the images overlap perfectly. This is easiest to see in the Difference mode or in any of the Red / Green or Blue Glasses modes. You can't tell what you're doing in the side by side or over and under mode.


          Once you are setup then switch the  3D glasses output to your desired format and you should be good to go.

          • 2. Re: Stereoscopic distortion or keystoning in AFX CS5.5
            Mylenium Most Valuable Participant

            Not sure I actually follow you here. With a converging rig the behavior would actually be correct, if the line is not currently in the focus/ convergence plane. You can easily verify this by alternating your eyes - straight lines always seem to tilt when you switch sides and are focusing on a point beyond and before the line. It just looks more goofy on screen if your eyes haven't not properly adapted to the fake stereo or something else is wrong because unlike in your real eyes, the perceptional filtering in your brain may not get it right....



            • 3. Re: Stereoscopic distortion or keystoning in AFX CS5.5
              Amir Stone Adobe Employee

              When your cameras are converging, the cameras are pointed inwards and will each get a slightly different perspective. Keystoning is expected in this situation, a side effect of having direct access to the convergence distance. You might be able to put on a corner pin effect to each eyes view to attempt to correct this.


              If you are using parallel cameras, there will be no keystoning, and you will need to reconverge your footage by negative your camera separation for the convergence point to be correct. But you are correct, your edges will clip. If you wanted to avoid this, you can do the reconvergence before 3D glasses-- that is hook up a slider to control the x position of your left and right precompositions.


              Check out this article for more details.




              After Effects Engineering

              1 person found this helpful
              • 4. Re: Stereoscopic distortion or keystoning in AFX CS5.5
                mikedavis57 Level 1

                Thanks for all replies to this.


                I'm fairly sure I've set up the rig exactly as intended.  To demonstrate the effect I mean, what I did was type three 1s across the lower part of the screen/comp, evenly distributed across the width of the screen.  Then three 2s across the centre, and three 3s across the top, producing three banners.


                Then set these three text elements/groups to be in 3D space, and put the 1s at z= -200, the 2s still at 0 (i.e. on screen plane), and the 3s at +200, so they were sitting back within the scene.  Then create a camera, turn it into stereo rig, and look at the output.  You can see the numbers toward the edges distorting away from the centre, whereas the three numbers in the middle vertical line are much more aligned between red/cyan.  Adjusting the camera convergence doesn't reduce it.


                Now compare this view with the 3D glasses effect.  Turn off camera convergence and use 3D glasses to 'digitally' overlay the two images.  Note there is now no vertical discrepancy creeping in, no distortion.  That's what I'm after.


                We shoot live 3D quite a lot, we don't usually see this amount of keystoning.  It just seems a bit extreme, and if there's any way to reduce it, then suggestions would be very welcome.


                AmirStone - if I wanted to set up a slider, what part of the stereo chain should I create it, in order for it to affect the left and right comps themselves?  Should it be in the same comp as the stereo controls, i.e. the Stereo 3D comp?


                Thanks everyone.


                • 5. Re: Stereoscopic distortion or keystoning in AFX CS5.5
                  Rick Gerard Adobe Community Professional & MVP

                  I'm wondering what your stereo scene depth is set to. This controls camera separation. Separation should be the real world equivalent of about 3 inches. Convergence must be on if you're getting keystoning. It should be set to Anchor Point. This value should be very small. Somewhere between 2 - 3% would be a good place to start.


                  You should be setting the convergence point using the Z offset. This is easily scene in a top view in the Main comp with both cameras selected. Now the rig is setup in the same way you would set up a 3D rig in the real world.


                  Only after the rig is setup should you go to the Stereo 3D rig and make adjustments to the Scene Convergence settings. In that comp you would adjust the convergence so that the Red and Blue (left and right eye) images converge on the element in the screen that is at the convergence point you set using the Z offset.


                  Does that make sense? Maybe a couple of screen shots would help. If I get time and you haven't figured it out I'll put up an example. For now, take a look at this example of the wrong way to do it:


                  Screen shot 2011-06-14 at 8.34.06 AM.png

                  • 6. Re: Stereoscopic distortion or keystoning in AFX CS5.5
                    Amir Stone Adobe Employee

                    "AmirStone - if I wanted to set up a slider, what part of the  stereo chain should I create it, in order for it to affect the left and  right comps themselves?  Should it be in the same comp as the stereo  controls, i.e. the Stereo 3D comp?"



                    Look in the stereo rig link I gave you earlier. It describes all this there. There is a section for converging cameras as well as parallel cameras.



                    • 7. Re: Stereoscopic distortion or keystoning in AFX CS5.5

                      Sorry to bump an old thread, but I'd like to know if there's an easy way to use parallel cameras and set a convergence plane (to get around keystoning).


                      Right now when I do it - I set up a parallel 3D rig and then precomp the left eye and the right eye separately, then move the precomps left and right to set my convergence plane, and then scale them up so they don't have black bars.


                      I'm pretty sure that help file link describes an expression that solves my problem...


                      This one -



                      3D Glasses effect Scene Convergence property expression

                      try {
                                      cameraOffset = effect("Stereo 3D Controls")("Stereo SceneDepth");
                                      if( effect("Stereo 3D Controls")("Converge Cameras") == false ) {
                                                          value - cameraOffset;
                                      } else {
                      } catch (e) {



                      But I'm really bad with expressions and I can't just copy and paste it.


                      Any help is appreciated!


                      Thanks a lot!


                      • 8. Re: Stereoscopic distortion or keystoning in AFX CS5.5
                        Amir Stone Adobe Employee

                        The key line for setting the Scene Convergence (which controls how far the left and right images are overlapping) is this one:


                        value - cameraOffset;


                        which basically means you will want to offset your left and right images by negative the camera offset. So for example, if your cameras are 50px apart, your left eye should be pushed 50px to the right, and the right eye should be 50px to the left.


                        Here is a more robust expression which handles the situation better if % of source is selected.

                        if ( effect("ADBE Stereo 3D Controls")("ADBE Stereo 3D Controls-0006") == 0 )


                             offset = effect("ADBE Stereo 3D Controls")("ADBE Stereo 3D Controls-0003");

                             if ( effect("ADBE 3D Glasses2")(5) == 1 )


                                  offset *= thisComp.width / 200;


                             value - offset;

                        } else {




                        Alt-click on the Scene Convergence, and paste it in there. Or write your own that does what I described above for the x positions of the left and right comps.



                        • 9. Re: Stereoscopic distortion or keystoning in AFX CS5.5
                          mikedavis57 Level 1

                          Personally, I gave up using expressions for this months ago.

                          Found it far easier to design the original comp at 2200x1080 resolution instead of 1920x1080.

                          Make camera, turn into stereo rig.

                          In the stereo 3D comp, set camera separation to be 2% (generally, unless the rig/camera's moving toward stuff).

                          Then make a new comp at 1920x1080, and stack up the left and right comps generated from the original when it becomes stereo.

                          I set top layer to 50% opacity, and just shift the left and right comps left and right by the same amount (e.g. left, 20px left, right 20px right) until I have the convergence point I want.

                          The extra bit on the sides from the 2200 prevents the edges showing and having to scale the whole thing up.


                          I know expressions can make things neater, but the simplicity of this works fine for me.

                          And if you render out the eyes and watch on a 3D monitor and decide you need to change something, you can just nudge bits left/right without the expression code sending it haywire.

                          I'm probably just rubbish at expressions, though.