Announcement

Collapse
No announcement yet.

Technique to Share PT1: Using Max for high quality 2D image warping

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Technique to Share PT1: Using Max for high quality 2D image warping

    I almost titled this: "How to Turn Max into the Most Expensive Photoshop Plugin of all Time."

    This is a technique I've been using off and on for a long time and kinda figured everyone knew it, but it seems maybe not, so thought I would share.

    The basic idea is to map an image to a piece of geometry and then use Max's (or any modeler really, but I use Max) tools to manipulate the image as you might in Photoshop, but in ways that are difficult or destructive in Photoshop. By using a simple script and a few edit poly modifiers the setup is fast and you can get endless control and levels of detail out of it, and the rendered images are actually capable of being even better than what can be done in Photoshop (my tests show that Max produces considerably sharper warps than Liquify, which is notorious for blurring images).

    The new Puppet Warp tool does provide a lot of this kind of functionality, but it's not nearly as versatile or as precise (when you need that) and not everyone has CS5 . However, the real beauty of this technique IMO is that it provides limitless control and "editability" which cannot be matched in Photoshop.

    Here are a couple of super quick image examples and video references of what I'm talking about:

    *EDIT* - had to remake and move the vids due to bandwidth issues. New (and smaller) demos on YouTube:
    Basic setup: http://www.youtube.com/watch?v=BVBWn4e8ymU
    Basic use: http://www.youtube.com/watch?v=rkqR4KyjXcc

    Fixing perspective: http://www.youtube.com/watch?v=OBNfWzdAC_w
    Bit more perp fix and some goofing around: http://www.youtube.com/watch?v=rkqR4KyjXcc






    The basic idea is this:

    1) Download Martin Breidt's great free script called "Image Plane" (link below). This automates the process of creating a geometry plane perfectly in line with a Max camera (must be a Max camera) and perfectly sized to match your render output.

    2) Select a file for warping. Take note of it's image dimensions in pixels. Create a new Max file (or use the one supplied below) and change the render output settings to match the image dimensions *exactly*

    3) In your Max file (if not using mine) create a Max camera. For ease of use throughout having it aligned to the Front direction.

    4) From a Front view create an Image Plane object (once the script is installed it is found in the create tab under "MB Tools". It is its own object type. Just draw it out anywhere and any size for now.

    5) Go to the modifer tab for the IP object and choose your Max camera. The image plane should snap to fill the full frame of the camera view, which should perfectly match your render output size. Make sure "safe frames" are on for the camera view. If the IP does not perfectly match then go to the modifers for that and change the "distance" parameter to any value, and then put it back to the default 100. That should refresh the image.

    6) In the Mat Editor create a new Standard material. Apply your chosen warping image to both the diffuse slot (for viewport visibility) and to the Self-Illumination slot. The SE map is what you will actually render (no lights used) and it should perfectly match the original image. Use the render settings in the supplied file and the rendered output will be virtually exactly the same as the original. I could not see any measurable differences - which is important (no quality loss just from putting the image through this process).

    7) Apply the material to the IP and make the map viewable in the viewport. The camera view should look like a snapshot of your image, exactly as it would appear in Photoshop.

    # To do basic "Liquify" type warping simply up the subdivisions of the image plane to create some nice geometry and start moving verts around. I use the Shift tool that is part of the Graphite modeling tools but there are countless ways to do it. Soft selections also provide a lot of flexible control.

    9) To make it easier while working I usually switch to a Front view - which should look exactly like the camera view anyway - so I can pan and zoom around without messing up the image/camera alignment.

    10) When done just render it out and move it back to Photoshop for further editing/blending etc.

    Because this is done with Edit Poly modifiers you can adjust it one vert at a time, or by edges, or any way you like, and can go back and change it as much as you like. Just keep adding more EP modifiers and you can stack up "layers" of warping. Adding Turbosmooth modifers *on top* of your warping provides a way of smoothing out sharp corners and "relaxing" stretching.

    A few tips:

    For cases where you want to move image parts around but preserve straight lines (almost impossible with Photoshop's warping tools) it is best to work with very low geometry - much like modeling. Use an EP modifer with "preserve UVs" activated and either move the edges around or create new edges that align with the image areas you want to move (i.e lay edges out along the sides of a building). Using "connect" and "cut" etc you can pretty much carve out whatever shapes you need. Then create a new EP modifier above that one, make sure "preserve UVs" is OFF, and edit the edges etc to do things like correct perspectives and manipulate more "geometrically".

    There are links to two quick example vids I made to show the basic idea. They are just playing around but the possibilities should be clear. The potential power is pretty high actually, and once the base file is setup it is very quick to change images out so you can save the base file as a "master" and just swap images and change the output render size to match and you can be up and running with a new image in seconds. Because it doesn't use lights and it does use Scanline the output renders are very fast - often just as fast or faster than Photoshop's tools would be.

    The two images attached (One is from an image library one is from the web) are just *super* fast/rough images I did to get the idea across. They show two general uses pretty well but ain't portfolio pieces

    The attached file is for Max 2010/2011 only. If you cant use it then you'll have to reconstruct it - I am only running those versions now.

    Have fun with the technique and if there are questions I will try and answer as best I can.

    b


    Link to Max 2010/2011 basic setup file:
    http://www.simmsimaging.com/upload/f...geWarp.zip.zip (849.57 KB)

    Image Plane script
    http://scripts.breidt.net/ImagePlane145.ms
    Last edited by simmsimaging; 16-08-2010, 05:10 PM.
    Brett Simms

    www.heavyartillery.com
    e: brett@heavyartillery.com

  • #2
    Sweet tip
    Two heads are better than one ...
    ....but some head is better than none.....

    Comment


    • #3
      When I have more time I will try to post some better examples. It's a really powerful toolset once you get your head around it.
      Brett Simms

      www.heavyartillery.com
      e: brett@heavyartillery.com

      Comment


      • #4
        Never really extended max in this way, (usually we use max to 're-take' photographs) but I can certainly see a use for this technique.
        Out of interest, what graphics card is in your system? We struggle to get texture maps to look as good in our workstations.
        Kind Regards,
        Richard Birket
        ----------------------------------->
        http://www.blinkimage.com

        ----------------------------------->

        Comment


        • #5
          Originally posted by tricky View Post
          We struggle to get texture maps to look as good in our workstations.
          I assume you've changed the texture size settings? Check on 'match bitmap size as closely as possible' too.

          This is pretty cool - i've used max to do semi 3d rostrums before, and camera paths where it just rotates inside a 360 pano.

          Comment


          • #6
            Originally posted by tricky View Post
            Never really extended max in this way, (usually we use max to 're-take' photographs) but I can certainly see a use for this technique.
            Out of interest, what graphics card is in your system? We struggle to get texture maps to look as good in our workstations.
            The vid card is a GTX285. The main thing is to have the settings adjusted as Neil pointed out though. Some vid ram is probably key for uber hi-res though.
            Brett Simms

            www.heavyartillery.com
            e: brett@heavyartillery.com

            Comment


            • #7
              Originally posted by cubiclegangster View Post

              This is pretty cool - i've used max to do semi 3d rostrums before, and camera paths where it just rotates inside a 360 pano.
              Using Max to create complex 3D motion blurs in 2d images is the "PT2" of this. It's a bit more setup in dome cases but can open things up that just can't be done otherwise in Photoshop (without literally painting parts anyway). Rich Rosenman helped me figure that out and it can come in very handy.
              Brett Simms

              www.heavyartillery.com
              e: brett@heavyartillery.com

              Comment


              • #8
                Originally posted by simmsimaging View Post
                The vid card is a GTX285. The main thing is to have the settings adjusted as Neil pointed out though. Some vid ram is probably key for uber hi-res though.
                Yes, we've done that, yours just seemed particularly clear though. Our cards are ATI FireGL V7350 (1GB memory). We paid a fortune for them a few years back. TBH, I can't say I've been massively impressed with them. Though having said that, if I were to rip out the card and put a basic one in there, I'd probably notice the difference.
                Kind Regards,
                Richard Birket
                ----------------------------------->
                http://www.blinkimage.com

                ----------------------------------->

                Comment


                • #9
                  Sorry - bandwidth was blown through pretty fast so I had to remake some demo vids to put them on youtube instead. New set of links in the first post.


                  b
                  Brett Simms

                  www.heavyartillery.com
                  e: brett@heavyartillery.com

                  Comment


                  • #10
                    Originally posted by tricky View Post
                    Yes, we've done that, yours just seemed particularly clear though. Our cards are ATI FireGL V7350 (1GB memory). We paid a fortune for them a few years back. TBH, I can't say I've been massively impressed with them. Though having said that, if I were to rip out the card and put a basic one in there, I'd probably notice the difference.
                    Dunno - I don't think it was much a problem with my old card (8800) but can't remember now.
                    b
                    Brett Simms

                    www.heavyartillery.com
                    e: brett@heavyartillery.com

                    Comment


                    • #11
                      I'm not having much luck with the Image Plane script. I've tried a few times to pick a standard max 'free' camera, but it doesn't seem to fill the frame. I have safe frames on and I've tried modifying the distance parameter. Any clues? We're on Max 2009 64bit.
                      Kind Regards,
                      Richard Birket
                      ----------------------------------->
                      http://www.blinkimage.com

                      ----------------------------------->

                      Comment


                      • #12
                        It's always been pretty good for me.
                        Just to be clear:
                        1) create the camera
                        2) create an Image Plane - just draw it out to any size.
                        3) Select the image plane then go to the modifier tab - select camera and pick your free camera.

                        The image plane should snap to the same proportion as your render size settings and snap to fit perfectly in the camera window. That's not happening?

                        One way to "reset" the image plane if you change the render size or something is to adjust its "distance" parameter and then reset it to 100. That will force and update. If that doesn't work then not sure what's up, but you could send me your scene and I can try it here for you.

                        b
                        Brett Simms

                        www.heavyartillery.com
                        e: brett@heavyartillery.com

                        Comment


                        • #13
                          Will give it another try.
                          One thing though:
                          I am using IP to generate accurate texture maps. I want to use a BerconTile texture on the IP. The BerconTile texture is designed to be exactly 10mx10m. I therefore need to make the IP exactly 10m x 10m. Perhaps this is the problem? I will try with the default 1m x 1m IP and see if it works.
                          Kind Regards,
                          Richard Birket
                          ----------------------------------->
                          http://www.blinkimage.com

                          ----------------------------------->

                          Comment


                          • #14
                            I haven't tried that exactly, but I never used the default IP size either - just randomly drag out the shape in a viewport since it gets auto-sized when you select the camera anyway, and for what I'm doing the size is irrelevant, only the res matters. It could be that the specific units is causing the issue.

                            Really though, the actual size is not important - you just need a 1X1 proportion for the IP, and then just make sure you render it at sufficient res that when you re-load the bitmap it scales properly. I don't use real world size for textures so maybe the workflow is more complicated, but that would work in principle.

                            b
                            Brett Simms

                            www.heavyartillery.com
                            e: brett@heavyartillery.com

                            Comment


                            • #15
                              love it! great tip, thanks for sharing.

                              file under: why didn't I think of this before.
                              www.peterguthrie.net
                              www.peterguthrie.net/blog/
                              www.pg-skies.net/

                              Comment

                              Working...
                              X