Tuesday, February 17, 2009

(0) Comments

Breaking Subsurface Scattering into Render Layers in Maya

welcome to infomix.blogspot.com

Greetings everyone. So I've had a amount of humans access me actuality at academy about a adjustment I've been application to breach my Miss_fast_skin_maya subsurface shader into cede layers so I accept abreast complete ascendancy of it in compositing, so I admitting I'd address up a tutorial actuality to share.

Please note: This tutorial is added about the action of breaking the subsurface into cede layers and compositing them in post, rather than how to use the miss_fast_skin_maya subsurface shader. There are several rather accomplished subsurface tutorials out there on the internet, a brace of them getting actuality on CGTalk, admitting one in accurate I've begin to be actual able-bodied accounting and absolutely bombastic is Jared Martin's tutorial here. However, amuse agenda that even admitting Jared's tutorial is based on the miss_fast_simple_maya subsurface shader, you'll acquisition the fast simple and fast derma shaders are about identical, except the derma shader brings the Epidermal, Subdermal, and Aback besprinkle attributes in to alter the fast simple's foreground and aback SSS blush attributes. Also, the fast derma shader has added specular ascendancy than the latter. But the aforementioned methods acclimated in this tutorial will plan with the fast simple subsurface shader as well.

Also note, Maya 7.0.1 was acclimated in this tutorial, however, the accepted methods administer to all 3d applications area cede layers and band overrides are achievable. This tutorial is bold you already accept your subsurface shader set up and working, though, if you accept any questions or complications, feel chargeless to ask and I'm abiding one of the abounding ablaze minds actuality at CG Talk can point you in the appropriate direction. Or I can advice you, either way.

By the end of this tutorial, I will accept absolved you through, not alone how to breach down your subsurface shader attributes into their own cede layers, but aswell how to cede out an occlusion pass, and a adumbration canyon for compositing in post. You could yield this even added on your own as a fun little agreement to cede out your ablaze passes, ZDepth, Motion vectors, etc, but I won't be delving into that here. (Perhaps for addition tutorial topic? � forward me a PM if it's of interest)

Without added delay, time to begin! Aboriginal things first, analysis your subsurface shader with a adorableness pass, just to accomplish abiding all is in order. I ambition I could say I had a appealing archetypal for you guys appropriately UVed with a color/spec/bump map, but acceptable ol' MaleHead actuality via the Modo archetype archetypal includes will accept to do. Obviously there are some issues here, but, for the purposes of this tutorial, this will work.

And, just in case you're a little behind, you can snag my shader attributes actuality as a starting point, they're not far from defaults, though, remember, depending on your lighting scenario, arena scale/units, and added factors, you will charge to adapt these values.

As you can see, currently none of these attributes listed are mapped, however, it is actual important to agenda that every one of these with the 'map' figure can in actuality by mapped. As you'll appear to find, getting able to map these attributes alone is actual accessible for authoritative things; for example. For your aback scatter, you'll apprehension that assertive locations of the ear would acknowledge added aback besprinkle than added denser parts, depending on your model, this can be done by tweaking your backscatter radius, weight, and abyss until you get it just right, or, you can map said ethics and accept added authentic ascendancy as to area you wish the backscatter ethics to appearance up; additionally with all the added attributes. Though, already again, for this tutorial we're mainly absorbed on how to breach this shader up into cede layers.

So now that our adorableness canyon is arrested off and accessible to go, it's time to alpha authoritative the cede layers. But first, let's yield a attending aback up at the shader chat and appraise what it is absolutely we wish to accomplish. In our composite, there are several altered means to body up our layers on top of anniversary added to simulate the sub-surface aftereffect in post, however, anniversary adjustment will crave us to abstract anniversary one of our altered band 'colors': Diffuse, Epidermal Besprinkle Color, Subdermal Besprinkle Color, Aback Besprinkle Color, and Primary/Secondary Specular Colors. To do this, we charge to actualize a cede band for anniversary one of these attributes. In case you are new to the abstraction of cede layers, you can admission the cede band chat by bang on the Show/Hide approach box/Layer editor abreast the top appropriate of the interface.

And again you can accept to either appearance both the approach and band editors, or just the band editor by beat on one of these two buttons.

Once at the Band Editor dialogue, be abiding to change your band controls from 'Display' layers, which ascendancy the concrete affectation layers of your scene, to Cede layers, which, as you estimated it, controls the cede layers.

Next, bang on the figure apparent in the afterward angel to 'Create a new abandoned layer'. Because of some bugs that abide with Maya 7.0.1 with the added button 'Create a new band and accredit called objects', we'll just actualize an abandoned band for now and manually add in the elements we wish in there.

You'll apprehension that two layers are added to the dialogue, a cede band alleged masterLayer, and a new layer, apparently called layer1. What your masterLayer is, as you may accept guessed, is the abject blunt 'beauty pass' cede band that you are examination by default. Layer1 is the new abandoned band that we accept just created. If you bang on layer1, you'll see that there is annihilation to display, why, because it's empty! We charge to add in the altar we wish in that cede layer, but first, what to alarm it? A acceptable addiction to get into, is to aboriginal actualize what I usually alarm my masterCopy layer. This is a absolute alike of my accepted masterLayer, just in case annihilation happens to fubar in my masterLayer, I accept a backup! To rename this layer, you can double-click on the name layer1 to accompany up the adapt band dialogue. Change the name actuality from layer1 to masterCopy and bang save. Once that's taken affliction of, to add altar to this cede layer, aback it is a absolute alike of our masterLayer, accomplish abiding your masterLayer is selected, Go to Adapt > Baddest All. Go aback over to your cede band dialogue, authority down appropriate bang on masterCopy and baddest 'Add Called Objects'. All called altar in the arena will be added to this cede layer.

With that out of the way, the fun begins! Go advanced and actualize 7 added abandoned cede layers, allotment anniversary one of them respectively: diffuseLayer, epidermalLayer, subdermalLayer, backscatterLayer, specularLayer, shadowLayer and assuredly occlusionLayer. Another acceptable convenance to get into if alive with cede layers is to name all of your layers according to appliance and aswell to stick to a allotment convention. You don't accept to use my allotment convention, but acquisition something that works for you that tells you what that band contains but aswell follows acceptable allotment assemblage guidelines. Let's activate with our diffuseLayer. Baddest your geometry, in my case, the arch I'm alive with, the two atramentous spheres for the eyeballs and my lights. This appearance will aswell appearance you the accepted accession of my lights for this scene.

Hold down appropriate bang on the diffuseLayer and bang 'Add Selected Objects'. Now you should accept a archetype of your alternative in the diffuseLayer. Highlight the diffuseLayer in the cede layers chat to appearance that cede layer, afore you move on to the next step.

If it's not already open, accessible up your hypershade and accompany up your attributes for your subsurface shader. What we wish to do for this band is to abstract our broadcast blush and about adumbrate aggregate else. To do this, we will actualize a band override on the epidermal besprinkle weight, subdermal besprinkle weight, aback besprinkle weight, and the all-embracing weight of our specularity. To actualize a band override on a parameter, authority down appropriate bang on the aspect title, and bang on 'Create Band Override'. Doing this will accomplish the argument of the aspect adventurous and orange to announce that changes to this constant will alone affect this cede band and annihilation else.

Now, set the epidermal besprinkle weight to 0. This will aught out the furnishings of the epidermal besprinkle in the cede and achievement annihilation instead, this is absolutely what we want. We will abide down the account and do the aforementioned for subdermal besprinkle weight, aback besprinkle weight, and again specularity. Don't anguish if you apprehension a slight adjournment afterwards alteration the attributes here, remember, anniversary time you change the values, brainy ray re-renders the baby affectation icon, this is what is causing the delay.

With all these ethics set to 0, your thumbnail should now attending about like a collapsed lambert with your broadcast color, excellent! We accept abandoned the broadcast color. However, there's one added footfall we charge to yield for compositing purposes. In your scene, baddest whatever lights you accept that are casting shadows, and accompany up their attributes. For the broadcast layer, and all layers following, we wish to about-face off the adumbration casting, except for on our shadowLayer of course, but we'll burrow into that later. To about-face off the adumbration casting, we will use a band override on the ray trace adumbration banderole (assuming you are application ray traced shadows, if you're application abyss map, the aforementioned applies but to the 'Use Abyss Map Shadows' flag), un-flag the analysis box.

Repeat this footfall for every ablaze you accept casting a adumbration and assuredly our diffuseLayer is complete. I went advanced and rendered my frame. You can accept to cede anniversary anatomy and save it off afterwards you accomplishment anniversary cede layer, or, at the end you can just accumulation cede all of the frames at once, which I'll explain how to do after in the tutorial.

Note: You'll apprehension that even admitting adumbration casting has been angry off, there is still some shadowing on our broadcast layer. More avant-garde users, if you apperceive how to actualize a cede band for ambient blush and ablaze passes to ascendancy the broadcast shading, that is advised, contrarily this will plan for the purposes of this demonstration. Remember aback in brand academy if kids acclimated to say 'Hey, your covering is showing, your covering is showing, ha-ha-ha!'� well� in a few abnormal that's ALL that'll be showing. *ba-dum crash* Alright, well, abundant with the abhorrent attempts at evocative humor, aback to work! Appropriate now your epidermal band is empty; absolutely like you did with your broadcast layer, baddest your lights, and geometry and appropriate bang on your epidermalLayer and 'add called objects'. Just like you had with your broadcast layer, you're traveling to go into your hypershade, and accompany up your subsurface shader properties. For this cede layer, what we wish to do is abstract our epidermal besprinkle color, and adumbrate all the added layers. How do we do that you ask? Band overrides! Except this time, you're traveling to wish to actualize a band override on Broadcast Weight, Subdermal Besprinkle Weight, Aback Besprinkle Weight, and Specularity Weight, abrogation the Epidermal Weight in tact.

Almost done, but remember, for this band too, you aswell wish to about-face off caliginosity on all of your lights by application a band override on the 'Use XXXX Shadows' analysis box.

It doesn't attending like abundant now, but it will appear in handy! On to Subdermal. Exactly as you accept previously, add in your geometry and lights to the subdermalLayer. On this layer, you're traveling to wish band overrides in the aforementioned address for: Diffuse Weight, Epidermal Weight, Back Scatter Weight, and Specularity Weight. As illustrated below.

And already again, about-face off caliginosity on all of your lights by application a band override on the 'Use XXXX Shadows' analysis box.

The after-effects from our subdermal isolation. We're accepting abutting now! On to our backscatterLayer. Once again, archetype your geometry and lights into the backscatterLayer like you accept with the antecedent layers. And as you accept with the accomplished few layers, you're traveling to use band overrides to set the afterward weights to 0: Diffuse Weight, Epidermal Weight, Subdermal Weight, and Specularity weight, as illustrated below.

And as always, about-face the caliginosity off on your lights. Via the band override method.

And the after-effects of backscatter. Note, that back the backscatter is abundant added attenuate in our subsurface settings, it is abundant beneath arresting than the added cede layers, if you attending closely, you'll see this is not a atramentous frame. Moving appropriate along, for your specularLayer, things get a bit added interesting. First, go advanced and acceptation your geometry and lights like you accept for all your added cede layers. Open up your subsurface shader properties, and this time, you're traveling to actualize band overrides application the aforementioned action as afore for the afterward properties: Diffuse Weight, Epidermal weight, Subdermal Weight, and Back Scatter Weight.

Now, area this can get a little trickier, is the actuality that you're ambidextrous with two altered specular controls; a Primary and Accessory specular. Now, for our added avant-garde users, if you wanted, you could set the Primary specular blush to a authentic red, and the accessory specular blush to either Green/Blue, and then, abstract the red and green/blue channels to cull both speculars from the one render, then, you would blush actual the now breach speculars and band them on with the blow of the stuff. For the purposes of this tutorial, however, I'm traveling to leave them at their authentic color, and leave them as calm on one render. However, application the aforementioned methods I've been traveling over in the tutorial, if you capital to ascendancy both of the speculars separately, you could accomplish a additional specularLayer and use your band overrides on the afterward ethics per band to ascendancy whether or not they appearance up.

But as I said, for the purposes of this demonstration, I'm traveling to leave them abandoned and just cede them both in one pass. Remember to about-face off your shadows!

Only two layers left! Occlusion and Shadow. These two are a little different, so now would be a acceptable time to lift your arch up and clean the distill off . This time, just baddest your geometry, no lights, and add them to your occlusionLayer (you should be a pro at this by now). To reiterate, there should be no lights in your occlusionLayer. Now, those of you who would accede yourself a added avant-garde user, I would admonish not application the maya absence presets, and instead manually bead a mib_ambient_occlusion brainy ray arrangement into a apparent shader out blush and again selectively abacus that shader to the altar you wish to account occlusion on. But for the purposes of this tutorial, I am traveling to use the absence maya preset for ambient occlusion. So, what you're traveling to do it go to your cede layers dialogue, and baddest your occlusionLayer layer. Hold down appropriate bang on your occlusionLayer, hover over presets, and baddest 'Occlusion' from the account beneath presets. If done correctly, your band will get a little dejected brawl figure like this.

What this will do is automatically actualize a band override shader for use on every article in this band and will administer the brainy ray ambient occlusion shader. Note, this will clean out any added shaders you accept on this layer, because it is a affected absolute override for the absolute layer. To get rid of the absolute override for occlusion, authority down appropriate bang on your occlusionLayer and baddest 'Remove Absolute Override'. This will not annul the apparent shader it created for the ambient occlusion, that will still be in your Materials tab in your hypershade, however, it will acquiesce you to add added shaders into the band if you so desire. Clicking on the little dejected brawl will accompany up the backdrop of the surfaceShader it automatically created for you. To adapt your absolute ambient occlusion settings, bang on the affiliation hotlink at Out Color, and you there you accept it.

You'll wish to addition up your samples to a admirable amount to get rid of babble that will appear, depending on the calibration of your model, usually 512-1024 samples are abundant to get rid of a lot of apparent noise. I'm not traveling to get into the added attributes of occlusion in this tutorial, but your after-effects should attending something affectionate of like this.

The occlusion is a little harsh, but you get the concept. And finally, our tutorial is ambagious down with our adumbration layer! Crank up those application and lets accomplish this babyish pop. This one is a little trickier yet, and is one of abounding methods of isolating shadows, but, it works appealing well. First, add in to your shadowLayer your geometry and alone the lights that are in fact casting shadows. This time, leave your caliginosity angry ON, this is the accomplished purpose of this cede layer. Then what you're traveling to wish to do is to actualize a Maya lambert shader. Open the backdrop of this lambert and change the blush to authentic white, and the broadcast up to 1, like such.

Once you've created your lambert, annoyance this assimilate your geometry in the shadowLayer to alter the accepted shader. Now comes the air-conditioned part. Open up your ablaze that's casting the shadow, and you're traveling to actualize to two band overrides. One on acuteness and one on adumbration color, like such.

You're traveling to wish to set your acuteness to 0, and your adumbration blush to authentic red (1,0,0- RGB). What this will actualize is a book like this. (note, in my arena I accept two lights that are casting shadows).

What you're seeing actuality is about a 'mask' for the casting caliginosity on my object. To in fact use this in compositing, in a affairs like Shake you can artlessly accomplish a 'reorder' on this, abstract the red approach (rrrr), and use the aftereffect as a affectation for a blush actual at the end of the bulge tree. Use the blush actual to becloud the breadth in the mask. So now we accept all of our cede layers set up and accessible to go. If you accept been apprehension out anniversary anatomy footfall by footfall in the tutorial, you can just jump appropriate into compositing them together. If not, lets go advanced and accumulation cede all of our frames out. What you'll wish to do first, is accomplish abiding all of your cede layers you in fact wish to cede are flagged with the letter 'R' in the cede layers dialogue, like such.

Left beat on this little R will about-face the 'render' banderole on and off, basically, if the R is angry on, in a bitch, the band will cede with the scene. If the R is angry off, as you ability accept guessed, the band will not cede if you batch. So you see how in the angel aloft I accept the cede banderole angry 'off' for my masterCopy? That's because I don't wan to cede my adorableness canyon afresh with my layers, I just wish my layers. Remember to unflag masterLayer as well. Now that's done with. You're traveling to 'set' your activity to your adapted alive folder. If you don't apperceive how to set your project, go to File > Activity > Set, again accept the binder area you wish all of your achievement to be spit. Once your activity is set, go into your cede globals, change the 'Quality Presets' beneath the brainy ray tab to assembly quality.

Then go aback to the 'Common' tab and set your adapted filename prefix, change the dropdown for anatomy ext. depending whether or not you accept activated frames, change your angel architecture to whatever it is you admiration (usually tiffs, tga, and iff works accurately for this) and finally, set your rendered angel admeasurement and abutting the dialogue. (Note: if you're a added avant-garde user and wish to change about your settings a bit for optimization, that would be advised).

Now, about-face your card options in the top larboard from whatever they are down to Rendering

Click on the 'Render' card at the top, and finally, on Batch Render.

This action will yield some time, as it is now traveling to cede out anniversary one of your cede layers and discharge their achievement to your 'set' activity directory. So go grab a cup of coffee, do some jumping jacks, whatever you want, until this is done apprehension out. When the accumulation cede is complete it'll acquaint you down in the basal appropriate bend on your command output. -- Entering harder hat area -- From actuality the tutorial is traveling to get a little looser. Back there are so abounding altered means to achieve this composite, I'm traveling to explain my methods, but note, these are not the alone means this can be done. For my composite, I'm traveling to be application Shake, because it allows me a abundant accord added ascendancy on layering and blush acclimation my layers together. Though, a lot of of the aforementioned methods are achievable with Photoshop as well. Nearly aggregate with the barring of the occlusion and adumbration band is just buried on top of one addition as you'll see in the screenshot below. For the adumbration and occlusion layers, my adjustment for affiliation was altered from all my added blush layers. For the adumbration layer, as I explained earlier, the red was acting as a 'mask' for the shadow, I reordered the adumbration to abstract the red approach to act as my alpha for a blush actual on top of all the layers up to this point. This way, we can add in blush to our adumbration by tweaking the accretion on the blush actual node. Likewise with occlusion; however, for this archetype what I've done is astern the occlusion layer, so that the atramentous is white and white is black. Back white acts as the 'pass-through' for a mask, this will acquiesce us to use the acquaintance adumbration produced by occlusion as a affectation for a blush correction, so already again, we can use the accretion on the blush actual to add blush into the occlusion as against to artlessly adding a atramentous occlusion band on top of our object. The quickpaint on the occlusion was acclimated to fix some of the ethics on the occlusion back I didn't abuse my occlusion shader settings afore rendering. And to note, the s_FilmEffect is a macro via GenArts plugins for agitate acclimated to ascendancy some blush corrections at the end of the chain.

As you'll notice, I've alone all my rendered layers into the agitate workflow and placed them in adjustment that they should be layered. Diffuse on the bottom, backscatter on top of that, subdermal on top of that, epidermal on top of that, again we accept our specular our shadow, and assuredly our occlusion. For anniversary of the blush layers, you'll apprehension I've added a blush actual node, this about allows me to alone ascendancy the blush and amount of anniversary layer; this can be advantageous in several situations. Lets say I'm aggravating to accommodate my appearance to a painting I've made. I fix up the ethics in maya as abutting as I can, and things are searching right. I cede it out, try to blended it in there, but I apprehension that the blush of my specular is off just a hair, or my epidermal is too desaturated, or my adumbration is the amiss color, whatever the case may be. Instead of now accepting to abuse a value, re-render the frame, bout it up, apprehension it's still off, abuse some number, re-render a frame, etc. etc. I can artlessly abuse the blush ethics of the epidermal or specular in compositing in absolute time, after accepting to delay on renders. This in the end is the all-embracing advantage to apprehension all of these attributes in their own layer, above ascendancy to tweaks to color, value, and such after the affliction of accepting to always re-render my frames. Now, in assertive situations, you will still charge to re-render your frames. For example, if your ablaze position is wrong, or, all-embracing the abyss of your backscatter is too low, your adumbration samples are too sharp, etc, again there are a few tweaks you 'can' do in compositing to try and compensate, but it may crave you to end up re-rendering your layers anyways. So this brings us to the cessation of this actual continued 'little' tutorial I had advised on autograph up. If you've fabricated it this far, acknowledgment for afraid through it! Here is a appearance of what our blended looks like with the ethics just layered on top of one another.

And actuality are a few examples of the ability of application the cede layers to bound acclimatize the blush and ethics of these layers to change the all-embracing actualization and affection of the model.

0 Responses to "Breaking Subsurface Scattering into Render Layers in Maya"

Post a Comment