Archive for December, 2011
In furtherance of last week’s entry, I decided to continue my pursuit of the birail tool in Maya, and it has been something of a revelatory experience. With the discovery of a couple additional tools used in combination with the birail, I now realize the potential to avoid much of the absolute mess that comes with building the model and having the polygons that you’re trying so hard to sew together only to find that they just do not line up, or have a huge discrepancy in the number of polys from one side to the other, forcing you to spend (oftentimes) hours figuring out how to route the edge loops and still have the model move and deform correctly as it should. With all the work at stake, you really don’t want to have to revisit the model’s construction. Here’s a workflow that might help you out if you find yourself in my position.
Before we start, here’s a list of the tools we’ll be using in this entry:
Modify–>Convert–>Polygon Edges to Curve
Create –> Bezier Curve Tool
Edit Curves –> Open/Close Curves
Edit Curves –>Detach Curves
Edit Curves –> Attach Curves
Edit Curves –> Cut Curves
Surfaces –> Birail 2 Tool
As the basis for this week’s example, I’m pulling one of my old characters out for a re-design. It will also be a test to see how effective the technique I outlined with a throwaway model in my last entry, with one that actually may have use for me in the future. Matt Wulf was the first comic character I created. As my drawing experience at that time was almost non-existent, he wasn’t that well designed, and even in his last incarnation, he, as well as the rest of the cast tended to lack visual structure, something I’ve come to appreciate more in the years between. Worst of all, he seemed generic. So here I’ve opened a Maya window and put in a new profile and front view of the re-designed head behind their respective cameras. Of special note, is the emphasis on lines that delineate structure in both views.
Last time, with the leg example, I used the basic side-front camera views to model profiles on the axis, but this meant I still had to reposition the curves for alignment afterward. To skip some of that this time, we’re going to start with a few construction planes. It should also be noted here, that in doing this, it’s essentially taking the lesson from my entry here and simply adding a little bit of planning, and different modeling tools.
So I’ll start with the construction planes. We’ll do the muzzle shape first.
One for the side, one for the front and one for the top. Making the side plane ‘live’, we can switch to the side view, and draw on the canted angle using your preferred method for curve creation (in this case, a bezier curve) thus:
Now, thinking about how high a resolution I’d like to maintain for the model, in this case, about two polys per inch, I see that the coverage on the projected plane surface is about 4×4 inches, so I’ll aim for a poly grid that’s 8×8. But we can’t use the birail tool like we want to until we have at least four curves whose ends all touch. Fortunately, Maya’s Edit Curves menu includes Detach Curves, which will break apart the single curve into multiples wherever we wish to do so, while leaving the ends of each in tangent with the others, as the birail tool requires. Choosing the points to break apart the curve becomes easier with practice, but the general idea is to imagine where the edge flow will merge with your next application of this cycle on a conjoining part of the anatomy. In this case, the shape almost suggests four sides, with corners at the bridge of the muzzle, the corner of the mouth, the tip below the nose, and… somewhere in the sweeping curve on the front of the muzzle? That’s going to take some judgement, but one clue is generally looking in the area of the curve apex. Choose these points by right clicking on the curve and selecting “Curve Point”. If you hold down shift now while clicking, you can select all four points at once, and then click on detach curves, giving us the following:Now to keep track of direction, I came up with my own convention for using the birail tool. That is, I always select top-bottom before left-right. This isn’t a law or even a rule, but just a good principle that you should probably have a convention that works for you and stick with it. There still may be times when you want to switch convention, because the quality of the mesh may differ substantially using the opposite convention. If you’re satisfied with the results of your regular convention though, then you’re good to go. The first pairing of curves you pick will be divided into the number in the “U” field, less one, while the second pairing of curves will be divided into the number in the “V” field, less one. The settings used for the birail tool are covered in the previous entry, for reference if you need it. Going on with my convention however, and applying the birail tool in using my convention yields:
And with a little application of the Sculpt Geometry tool set to “relax”…
I think now is as good a time as any to bring up a few troubleshooting points that I came across while refining this method. First, when creating your curves, you can use the Open/Close Curve tool to make sure you have a closed loop, which is great for saving you the trouble of snapping CV’s manually. However, be sure to remember that in doing this, the curve still has a discontinuity where the beginning and end of curve meets. When you begin detaching curves into components for the birail tool, this may result in a ‘fifth’ curve you didn’t plan on having, and it may be small enough in the viewport to easily miss and derail your birail, so to speak. It’s easily fixed by using the “Attach Curve” tool re-merge that extra strand with the nearest larger curve and we’re back to four curves again, like we should. Also, turn two-sided lighting off on all your viewports. It’ll help keep you aware of the direction all your surface normals are aiming, and letting you reverse normals as necessary to keep everything consistent.
Also of note, remember to ‘flush’ your history often. Some curve modification tools demand a clean object history to function properly (while others won’t work unless History is “on”, so you can’t necessarily turn it off completely either).
In any case, we’re ready to merge these two surfaces, so assuming you’re already familiar with how to do that, we’ll proceed from that point. Let’s select a row of faces on the first shell we created, because it’s the larger of the two (in poly count) and delete it. All that remains for a more natural blending here is to use either the Bridge tool, or the Append Polygon tool. The former is quicker, but often glitchy compared with the latter, so take that as you will.
Okay. Not too bad, but we’re not seeing much in the way of form yet. Let’s do the top of the muzzle next. I was going to use a construction plane here as with the other two surfaces, but on reflection, Matt’s nose is far too much like a ski-jump to use such a flat modeling surface effectively, so let’s look into using a makeshift Nurbs surface to use as a canvas and follow the contours more closely. I can still use the construction plane, but only as a place to create the dummy Nurbs surface. Note, that I don’t have to do anything in creating this nurbs surface other than make sure the shape and size is accurate to my eye. I’m not thinking about matching polys at all here, because I don’t have to any more, not until after we’ve drawn curves on this nurbs surface at least. That in itself is liberating.
Now I’ll take that little ski-jump there, and make it our live object. Then move to the front view where I’ll draw on it, following the contours of the bridge of the nose as closely as possible, and then bring it back up the mid-line. We can’t close the loop yet, however, because drawing a curve on a Nurbs surface the way we’ve done here makes the curve part of the Nurbs object, and we want the curve to be its own object. To do this, we go back to the Edit Curves menu and select the first item on the list, the Duplicate Surface Curves tool. Now that we’ve got the curve we need, we can delete the Nurbs object and close the curve to make it a loop. Then we proceed as we ordinarily would, detaching, and using the birail tool.
And as before, combining objects, deleting the appropriate number of edge polys, and bridging between the shells.
I get the feeling that if I were to just make a single birail surface out of this loop, it might end up being to ‘soft’ and button like. I want to add more structure, so I think I’ll do it in two passes, breaking down the single loop into two loops. The tactic I’m going to employ in choosing the locations to break the loop is twofold. I’m going to align those points as closely as possible to the perceived “turning edge” of the model where front becomes side or top, and two, line them up with the nearest vertex on the existing model. I’ll continue to re-attach and detach curves as I deem necessary to continue to create birails that sufficiently fill in the gaps and provide structure. I’ve numbered the edges as I reconfigure them to accommodate each successive birail in the following images…
In the last image in that string, you can see I pulled out the Insert Edge tool to accommodate the large polys that developed along the bridge of the nose.
Here’s a comparison shot to see where we’re at compared to the drawings.
The profile view is pretty much spot-on, though we can still see that in the front view, in the transition area between muzzle and cheekbone, there is some divergence. How I fix that will be evident when I pick this up in next week’s entry, where I investigate using these methods with solid stand-in shapes and intersections.
As a bit of a post-script to this entry, I have to wonder if anyone has come across this method of model-building yet, with so much potential to avoid the agonizing prospect of hammering away at vertices or individually building edge loop after edge-loop through extrusion. It’s just not a very intuitive artistic process. One of my fairly regular habits is searching for techniques and methods others have found in how they approach certain problems, and see if I can adapt them for what I’m doing. But on this particular subject, what I have found out there rarely ventures away from only the most rudimentary techniques. If anyone has any further ideas for refining or combining this method with others they’ve seen, I welcome all comments to that end.
As mentioned in my resources page, one of my most significant go-to books for drawing is the Force series, illustrating brilliantly how throughout living organisms, there is a rhythm, a path where metaphorical ‘force’ ricochets from one part of the body to the next. Keeping this in mind, I decided to see if there was a way to more directly translate or ‘sculpt’ in CGI modeling software (Maya, for the purposes of this entry) this concept, by starting with drawings that were produced using this method, but then arriving at a model by mimicking those methods using standard modelling tools in Maya.
Here’s where I started:
Just a very quickly sketched out leg. In retrospect, I could have pushed the forces a lot more, but you can still clearly see them sweep from the front thigh through the knee, into the back of the calf, into the heel.
Most modeling tutorials I’ve seen will either instruct the student to start with stock cylindrical objects and continue to push and pull vertices to match the geometry until you’re ready to peel back your eyelids from the sheer inanity, or create one edge loop at a time, bridging the new one with the previous. It’s an improvement, but a slight one.
I think, however, that I have found a way to more easily construct limbs and bodies for characters relying almost entirely on your sketches in the creation of the geometry rather than hammering stock geometry into your desired form. At the very least, it should minimize the amount of that kind of irritation.
Anyway, here we go…
I’ve imported the two views of the leg into Maya’s front and Side camera views respectively. In the Perspective view, that looks like this:
Now, in the Side and Front views, I use my choice of curve tools (in this case, a combination of EP curve and Bezier curve tools to trace the front and back side of the leg in the Side view, and the inside and outside profiles of the leg in the Front view. You’ll notice that they probably won’t line up the way they should, as the centerline of the limb is not necessarily plumb vertical the way the planes you’ve been drawing your curves on, are. With a few rotations and translations, you’ll get something that looks like this:
Also shown above are two loops that connect the tops and bottoms of the curves. These are important for the tool I ended up using to create the surfaces. Starting with the line towards the back (the heel side) and with curve-snap on, I used the EP curve tool to make the loops, and I moved in a counterclockwise (from above) direction in both. Consistency in creating the top and bottom loops is critical.
Next, I select the Birail 3+ tool from the Edit Curves menu and set it to the following settings:
Using the general tesselation setting here allows you to build the leg in four surface wedges that have the same number of polys along each edge and have them mostly line up closely enough that they can be merged more easily together in the following steps. Take note here! The number of polygons in the U and V directions will be one less than the number indicated in the initial tesselation controls. So if you want your limb to be 30 units long, enter 31 into the U field. You might also want to take note at this point of how many polygons you want your limb to be around as this will come in handy when modeling the torso and how many polys around the opening is for your limb to connect into. We’ll be doing this four times to bring the limb surface to a full 360 degrees before stitching all four together, so take the number in your V field, subtract one from it, and multiply by four. That will be the number to remember for attaching these limbs more easily later.
Starting again from the place where you started your loops, start the birail 3+ tool and follow its instructions, moving counterclockwise as before, one segment at a time until you’re at the last segment. Caution! Have two-sided lighting turned off here, so you can easily detect if the normals of the surfaces you’re creating in these steps are facing outward the way they should be! Also, in between each use of the birail 3+ tool, make absolutely sureyou remember to delete history on the surfaces.
Before you do the last quarter of the leg, Maya needs for the direction on the loops to be reversed (otherwise, it will span the paths opposite to the direction we need). I can’t say it enough, but make sure you’ve deleted the history on the other three surfaces you’ve already created or when you reverse the direction on the paths, it will affect your work, and when I say ‘affect’, I mean ‘make it look screwy’.
All right, once you’ve reversed the direction on the paths (Edit Curves—>Reverse Curve Direction) then you can finish off the last quarter by repeating the above process going clockwise this time.
We’re in the home stretch now. If you’re familiar with the basics of Maya, then you know how to combine objects, merge vertices, etc. It also can’t hurt to make sure once more that all the surface normals are facing outward before doing that.
Once that’s done, and with less than 30 seconds worth of smoothing and sculpting with the surface sculpting tools, here’s the final result, lit and rendered.
Now, you can tell this is still somewhat unrefined, but your starting shape is much closer to the end result than it would be using more traditional techniques. All the polys are quads, so they’ll deform quite well when animated, and using this method you can plan out your other limbs and the torso ahead of time more easily than (what personal experience has taught me) freewheeling lets you do.
Tonight I wanted to make lightning in Photoshop. No big deal, right? There are only half a dozen tutorials like this one already out there giving you the basics on how to do just that, and get more than adequate results.
Looking at that tutorial though, there are a couple of things which still limit your use of the technique. For one, and more easily addressed, you can improve results and get them faster by tightening the limits of the solid black and white areas when applying the gradient in that step. Less clean up time all-around, and that means more time for other things. But the bigger hold-back is that the technique uses gradients to generate the boundary that ends up forming the path for the lightning and that means you’re going to be stuck with the relatively few and simplistic gradient options, none of which really gives us that random, zig-zag path that we’re all familiar with and identify with lightning. The best offered is a straight-line gradient.
Stop. Now let’s think outside the box for a moment. The filter that is responsible for turning the gradient into lightning is the “difference clouds” filter, according to all of those tutorials, right? And what exactly is the difference cloud filter responding to? The perimeter of the fuzzy zone that gradients create. But there are numerous other ways to create that effect, like for example:
The point here isn’t just to show you a way to make your Photoshop lightning better (though if you found this blog because you were searching for it, well it’s your lucky day too!), but to illustrate why it’s important not to simply take your Google searches for granted. Yes there are plenty of answers from people who have already tackled the question you’re seeking the answer too, and they may be enough by themselves. But you can add to the chain of useful information instead of just receiving from it. Remain inquisitive. Never stop asking how something might be improved. Don’t think in terms of following rote instruction, but rather examine the process behind it, much like it’s the mission of this blog to do.
Look! Look to the right!
Under the Blogroll area you’ll see a new link. This takes you directly to the other blog I maintain here on WordPress, the one I dedicate solely to discussing my photography, the things I’ve learned about it, and the learning I’ve applied towards it.
Take a peek if you’re game. I welcome visitors there as well.
Going back to childhood, I remember clearly the oft-repeated words of one of my uncles come Christmas time. Almost inevitably, one or more of my fellow grandchildren and I would get a gift requiring assembly instructions, and just as inevitably we would dive into them heedless of any such trivial matters. There was play at hand, and we’re supposed to wait?
Of course, the results were sometimes less than the fun, and in those occasions, my uncle would remind us to “Read the instructions”, with insistent and monotone gravitas. Okay, so the mixed results we got in those circumstances probably warranted the warning, to some degree. On the other hand, in the arts, (and in learning software to boot) play is absolutely warranted. The more versatile the tool, the more enlightening play can be. Play, as a result of curiosity, is a key path to discovery.
Today’s example is a result of a little bit of just such goofing off: texture patterns. In CGI, the use of well-designed repeating patterns is key to creating believable renderings. Samples are often readily available online, but just as often the quality leaves one… wanting. There are a few ways around this. You can have the pattern repeat over the surface you’re rendering repeatedly, which can work for a few repetitions, but will often succumb to the pattern revealing itself in the render, not a desirable outcome. Another method is to simply increase the resolution of the pattern, but this too can do more harm than good, blurring and damaging the pixels in the process.
So what to do? Versions of Photoshop starting with CS5 have an alternative answer at hand. Once again, it’s the content-aware fill to the rescue. Here’s the setup: I have a photographed texture from an armadillo hide (A live one too. Let me get super close for the photo-op, but that’s another story) that currently resides at 1024 pixels square. Here’s what that looks like now:
Now I’m going to create a new file that’s twice the size at the same resolution so that it measures 2048 pixels square. Then I’ll go back to the 1024 px image and using the move tool, drag and drop that image into the new high-resolution new file.
Now flatten the layers and use the magic wand tool to select the white space surrounding the old texture and refine the selection edge using the option in the options bar by expanding the selection area ever so slightly. Then select edit>fill>content-aware fill. Now the white space if filled seamlessly with more armadillo-hide texture, but it’s not repetitive the way doubling or tripling up the smaller pattern over the surface would be. It’s covering four times the area but with no loss in resolution.
Now all that’s left is to choose your preferred method of making this new pattern repeatable. The easiest is to use a plug-in like PixPlant which I found off Adobe’s website, but there’s always the more traditional method of Filters>Other>Offset and then using the pattern stamp, the heal brush etc. to ensure a solid repeatable pattern.
Just so you know this works even on stuff sampled online quickly, here’s a wood pattern extrapolated from an original Googled sample only 425 x 319 pixels into a standard 1024 x 1024 repeating pattern.
Here’s the original:
And the resulting pattern. Note that in between, I edited the dark spot out on the right before running through the above procedure, and increased the saturation.
Lesson 1: When working in CGI, you now have the ability to increase resolution as an alternative solution to repeating the pattern excessively or blowing out the detail by increasing the resolution directly.
Lesson 2: Never forget the power of simply playing around.