Thursday, April 23, 2009

3 channel dirt passes

Another technical post about using multiple channels in one image to allow more control in post production, this time with dirt maps (I know some people/software use the term to refer to ambient occlusion maps, but I'm talking here about actual dirt or grime).

The basic premise here being 2-fold: 1) the use dirt maps to create a more realistic look, rather than worrying about bump maps and the like, and 2) to be able to use generic dirt maps to create a bunch of different looks in the final render by combining them in one rgb pass.
I'm going on the basic premise here that often in production you don't actually need bump maps to rough up a surface. Adding dirt to the specular/color components is often just fine to create a rough surface look. This technique is actually applicable if you do use bump maps, you'd just add another pass of three combined bump maps in the color channels (more later).

So what am I talking about? Let's say we have the following image:
(click for larger images)
and we want to dirty it up to get something like this:

Just a bit of dirt to give it some texture or character.
If you knew what you wanted, etc. you could just add the dirt maps to the spec shader, tweak it out to get what you want and render. But the way I'm approaching this allows for loads of changes in post and requires little thought in 3D. This isn't necessarily for every shot or production, but its really useful when you just want to generally dirty stuff up.
Here's how we do it, again using multiple channels to hold multiple images.

This scene in Maya is super simple: Just a sphere and some lights.

I've got three different dirt maps that vary in the size and "frequency" of the dirt (it's basically just black and white images of splotches and splooches if you know what I mean). Here's what they look like mapped onto the sphere:

So I have 3 B&W dirt maps. I map them individually to the R, G and B color channels of a material or surface shader. (one to R, one to G, etc) This will give me a false color image with 3 different images in each of the color channels which I'll pull apart later in post. I also have my spec shader and my color shader.

If I was clever, I would have done the combining of the images in photoshop to get something like this:

Then I would map each channel to the corresponding channel in the dirt material. But I'm wasn't clever here and used each image separately in Maya. No real difference, just more parts.
Then I'll set up my render layers. One for color, one for spec, and one for the dirt.

And here are my renders. Again the dirt will be pulled apart to give us more options in post.

So onto Shake (though, of course, After Effects or Nuke or whatever could be used). . .
The idea is that I'll use each channel of the dirt map separately and get 3 dirt maps from this, which I'll use to muck up both the color and the spec passes.
The basic operation I'll use in Shake is a "reorder" which just puts one channel into all of the other channels (ex. red channel into red, green and blue channels). I keep the alpha. I use a "compress" node to dial up the blacks and whites to the values I want (like transparency but just with color).

Here is the comp below. I've pulled two of the channels of the dirt on the left side, multiplied them together (we want only the dark bits) and multiplied them to the spec pass. This roughs up the spec. Then on the right side, I just copied the dirt nodes, changed the compression a bit and multed them to the color pass to dirty that up a bit also. Then I "added" the dirtied spec to the dirtied color.

Here are the passes once I've tweaked them in Shake (color, spec, dirt):

Once again, here is the final result, with the spec added to the color and both roughed up by the dirt maps.

I know it seems like a lot of work to do this in post rather than doing it in the render, but in fact, once you get the hang of it, it's actually easier and certainly more flexible. For example, I can instantly change both the look and intensity of the dirt right in Shake.

If I wanted to include bump mapping in this, I would simply create three bump nodes in Maya with a basic texture and map the color ouputs of those into the R, G and B channels of another shader (say, a surface shader) to get a "super bump" pass. I could then dial up and down any of the three bump maps in post the same way.
As I said, this isn't always the most efficient technique for every job, but if you export out the dirt map shader, you can instantly add grunge to any object you like and then have some more specific control in post.

Thursday, April 02, 2009

Watch out for the render ninjas . . .

On ur computrz, ajustin ur gamma.

a bit of painting. . . and jealousy

. . . So the other day I checked out the blog of this dude, Mark Behm, and I was blown away. I LOVE his paintings. I scroll down a bit and turns out he's also an awesome illustrator. Ok, makes sense. Keep scrolling and see that he's also a sick sculptor. Wow. Turns out he's also an amazing 3D modeler and texture artist. What? And he's got videos that demonstrate that some of his paintings are done in, like, 10 minutes. On screen. Man oh man, that's impressive! I click on a link and it turns out that he also animates feature films. Ok . . . now I want to kill this guy.
What the hell? Sooooo much talent. I linked to his site over there ------>
He is the first person I've linked to that I don't actually know. Does he care? Probably not. Too busy doing all that fancy art stuff of his better than 99.99% of people in the industy. Dick.

Anyways . . . he inspired me to realize that I suck, so I've decided to try being a bit more serious about drawing and painting. Not too serious, cuz then i might feel foolish, but a bit. Of course, ACTUALLY painting is a big step. So, instead, I'm gonna try to do a quick number in Corel Paint each day. Only for 30 mins or so (ok maybe an hour) just to try to get back in the swing of things, that is, to the degree that I was ever in the swing of things. Here are my first few efforts. If I ever do anything thereafter that I decide I like, I'll post it, but certainly not daily. This is more of a public benchmark for myself, I guess, to see if I get better later.

the "under coat". This is the stuff I forgot that I don't really know how to do well. . .

this is with muck painted over the last image.

today I saw a stupid trailer for "Wolverine" and then did this.

Hopefully next week I'll be able to post up some new Ilksvilles and maybe some other work. Otherwise, you can find me staring at this guy's blog and crying . . .