hello everyone this is reza welcome to another nuke video in this video we'll learn how to set up merged aovs inside maya and we'll learn how to catch shadow using arnold shaders we then take our single merge pass into nuke and we use a variety of techniques to extract layers out of that pass in the most efficient industry friendly workflow i squeezed a lot of tips and tricks in this video and i'm sure you will enjoy it so let's get to it [Music] now here i am inside maya we've already looked at this scene in the previous video when we talked about separate aovs is pretty much the same process i gave the ground ai matte shader and i use arnold lights for my scene two directional lights and one sky dome light in arnold and i assigned an hdr image into the color channel of my dome light now with that done it's time to open render settings make sure your arnold render or any render preferred render that you have is selected and in my case because i'm using arnold i have aovs tab and i've already gone ahead and picked all the preferred passes now this bit is very similar to the previous video when i talked about multi-pass rendering and compositing using single aovs so you can definitely watch that video and see how i went about that the only difference in here is i can right click of any of these guys and go select driver and go to attribute editor control a and make sure merged aovs is selected now another way to find that is i believe in common tab and merged aovs the rest you specify your image size renderable camera and frame range extension which in my case is exr you specify your samplings here and your ray depth and then with that you're ready to go now i'm going to go to rendering and render and through render sequence i render out my aov so basically for each frame you get one file one exr and all the passes are embedded inside that one frame i'm going to just render a single frame and as a result of that i'm going to get a single aov now let's uh render this out as merge the aov as a single pass and see how we can composite those passes together inside nuke here i am inside nuke i've rendered my a single exr pass successfully now if you're wondering where to find the extra layers because we no longer deal with individual passes they're all inside the layers so we can look at direct diffuse diffuse indirect emission shadow mat and some of these passes are a bit too subtle so if you for example don't see a specific pass you can always increase gamma or gain to see them individually for now i'm going to switch back to rgba and see how we can extract those layers as well and you can see we've got that green chip here saying that it's high dynamic range image rgba everything is ready to go i've brought in my back plate as well this is the exact same back plate i used in the previous video just to show you that you can get the exact same result using a slightly different method now i'm going to work with shuffle all the way through and i'm using again backdrops just to stay organized so i'm going to create a backdrop principles stay the same we are using the good old being organized sort of method i'm going to move the main pass up we are not going to place it here so i'm going to move this up i'm gonna bring this background to the side and let's just create a backdrop for the background as well here b g for backdrop i'm going to reduce the number of my property bins to something like two so i'm not going to get too many property bin windows open and probably i need to change the size of these guys as well that's better now as i said i'm going to use shuffle node all the way through so i will be using the new shuffle node available in nuke 12 version 3. so if i double click on it the interface is slightly different but to be honest video it does exactly the same but the new interface is more straightforward so i'm quite happy with this facelift that foundry did on this note here so let's have a look and see how we can fix that first things first i'm going to go to node and make sure my postage stamp is on so i kind of would like to see what i'm dealing with and then from here you go and pick your channel as usual we go with diffuse first and then we go to specular alpha so on and so forth so let's start with diffuse direct i'm going to connect that to my merged aovs and if i have a look at it you can see i have my diffuse direct now i'm simply going to press ctrl c ctrl v bring this guy to the position plug in pipe b to my merged aov and just change the name of shuffle 2 add a label basically to it and say diffuse indirect now we have this label correctly name i just need to make sure that i pick diffuse indirect and you can see i actually do have diffuse indirect it's just a little bit subtle bring this back to the position now exactly the way we merge these two together in the previous video we are going to do the same so i'm going to select diffuse direct press m it connects it to pipe a and b goes to diffuse indirect control to create a dot i'm going to select the merge node change that to plus and done if i look at it we have our diffuse passes successfully combined i'm going to do the same thing i'm actually going to continue with the same fashion so plugging this time let's say specular direct and i'm going to name that specular direct i'm going to copy and paste and make this one specular indirect that's great let's update the node as well so specular in direct and this one is specular direct using the exact same method specular direct m plugs it to pipe a b goes to indirect control to create a dot node and we have our specular passes combined now all i need to do just to select this guy and change the operation to plus now time to use these two categories diffuse and specular and merge them together as well i'm going to select merge 2 press m bring it over b goes in here and of course i'm going to change the operation to plus control create a dot node and i successfully combined diffuse and specular just like that so it's very very very straightforward very easy to work with and that's uh that's the main difference between individual passes and merged aovs and i find merge aovs actually much faster to composite but let's continue what else do we have we have subsurface scattering so let's bring it in i'm going to extend this backdrop and let's create another shuffle node bring it over here plug that to my merged aovs i'm going to pick subsurface scattering go to node enable postage stamp and just label it now we have subsurface scattering and all i need to do is to again bring it over and combine it so sub surface scattering pressing m we bring it over plug b goes to the main stream dot node and merge needs to be plus so if i look closely and update my viewer to merge four now we can see if i zoom on the teeth we can see that now we have subsurface scattering on the teeth now let's bring alpha so i need to create another shuffle node postage stamp on we call this alpha we move this and plug that into here and for alpha if you remember we used copy node nothing has changed let's use copy note the shortcut for it was the letter k so i'm going to select the shuffle node and press k that pipes the a into shuffle node and of course b goes to the main node tree i'm going to create my dot node and as usual usually red goes to alpha but if i look very closely i do have alpha here so this default setup will work all i need to do in my shuffle node i need to make a few changes i need to make sure that alpha in here goes to alpha in a destination so if i view this the beauty of it is if i press a i get my alpha that's exactly what i want so let's um let's continue i'm just gonna press a again to toggle to rgb now we have all the primary passes ready to go let's uh go ahead and set up our auxiliary passes so we want to keep the same structure that we had in the previous video and have our light pass and our id pass and depth pass in [Music] so [Music] now we have all the right backdrops ready to go let's create a shuffle node in here i'm going to again enable postage stamp and copy and paste them into each block makes everything much easier because just we use the same method and the same node type to extract the layers now i'm going to plug them all into my merged aovs now everything is plugged let's go and see what we can do for each individual pass now you can see that if you remember i had transmission and i also had emission attribute was another attribute that i had so i need to have two shuffle notes for my light inside auxiliary passes and don't worry about all the clutter that you see we are going to clean him up towards the end of this tutorial so let's focus on transmission for now so i'm just going to label that as transmission and inside this shuffle 7 i'm going to go ahead and find transmission in here if you remember for that transmission i had to drop in a grade node and that's exactly what i'm going to do because if i look at my transmission it's not really pronounced the effect so i'm going to do the same trick to highlight my transmission i'm going to go to grade node and multiply the values to something like 3 and add a little bit of gain 2. 5 should do it i try to stay with the same values that i used for the a previous video and that really should do it you can of course decrease gamma a little bit or increase them so you know just whatever goes for your taste you can do it also for the other shuffle node which is responsible type this emission first things first and then i will extract emission out of that so if i look at it i should be able to see the emission value correctly that is great now i need two glow nodes because eventually i need them to glow i need one glow call this one tight and with the tight glow i just need a very low value of size so probably six as you can see it's very very close to the edges i'm going to probably color it just a tad like so orange color will do brightness set to 0.
9 and then copy and paste that the secondary glow node and that secondary glow node is going to be a kind of widespread type of glow and i'm going to change the size from 6 to something like 30 and increase the redness increase the brightness and that should do it so these two passes already let's see how we can connect them into our main node tree now before i connect them to the main node 3 i need to connect them together using a simple merge node so a goes to transmission b goes to glow i'm going to create a dot node obviously this one is set to plus and if i connect them together i have both transmission and emission value with the right amount of glow and if you think this is too much once we combine everything together it's not going to be that strong this effect glow effect right here now it's time to use another merge node and just bring that merge node into the main node tree so i'm just going to bring it over here plug it in combine it all together and now we have glow on transmission on top of everything else you can see we have glow i can press d go before and after and that's that works beautifully for us yep that's done let's uh move on to ambient occlusion so if i go here and find ambient occlusion and view it you can see we have ambient occlusion um there's not much to it really um selecting ambient occlusion i'm going to press m bring it down b goes to the main node tree holding down control create another dot node so it's easier to read now what i said about ambient occlusion in the previous video and i'm going to repeat pretty much the same thing is if i view that obviously this is going to be plus and this is going to be multiply so you always use multiply for ambient occlusion now if you take a good look before and after we lose a lot of information one way is to play around with mix which is not preferred we tend not to touch that good idea is just to throw in a color correct so pressing c on your keyboard to create a color correct node and then just change the gamma so i'm going to put something like 4 or 3. 5 for gamma it dials ao back to whatever value the brief says so you can kind of fine tune it that way now ao is done let's have a look at depth for depth we go and pick depth and that goes into rgb a alpha now what we can do here is to create a copy node we just press k create a copy node we bring this down b goes to the main node tree holding down control creating another dot node so everything nice and clean double click now in this copy node we want to make sure that z depth goes into depth so depth z goes into depth z and we've already specified the right channel i'm going to label it well turns out i connected to the id so i'm just going to fix that apologies so that is correct i'm going to label this one correctly obviously id is id um as a matter of fact we have a custom id file so i don't really need to use that i can delete that i'm going to replace it with my own id here now i'm looking at this z depth and i've got the information i need so i can later on just throw in and a zd focus and fix my depth of field if need be now the approach for ids or id maps is using again shuffle node so create one shuffle node for red channel create another shuffle node for green channel and create another shuffle node yes you guessed it for blue channel now i need to plug them to my custom id now i'm going to select red shuffle node and i need to make sure that everything is disconnected red goes to rgb alpha for green green goes to rgb alpha for blue is the same thing now to plug them all i need a grade note so i'm going to go back in here just pressing g and the mask channel can go into one of these guys so probably in here i can just drop in a dot node one can go into the green channel and the other one can get information from the mask channel from my grade note now i'm going to just label that grade id now we don't need really to change this mask we can just leave it as it is we can just and see what channel we want to tweak so we want to tweak green we want to tweak red or want to tweak blue if i look at my green i want to multiply the values on the green channels on my render so all i need to do is to make sure that g is connected to my mask and when i look at my mask and change the multiplication so let's say i'm going to put 1. 9 only the green portion of my id is going to get affected so before after now we can tint that you can change lift gain offset or gamma you can even inverse the scenario so everything else will get affected but that color so very very efficient and quite powerful now lucky last i'm just going to zoom out so final pass is actually the shadow pass so you can actually go here and have a look at your shadow mat now what i have as my shadow mat i'm just going to label it now what i have as my shadow mat all the information i need is in white and i need to invert it so i'm going to press tab invert and invert the information it comes with the character and the shadow so i need to pre-molt it so type in premolt and it creates a holdout for me and that's exactly what i need and now with this in place all i need to do is just to plug this into my background here so before i plug everything let's have a look at my background my background is 6000 by 4000 whereas my actual pass is 606 for so i need to reformat this guy reformat so it's got the same size as my auxiliary and primary passes if i double click on this reformat i should be able to find this resolution here and just a side note another easier way of doing this so reformat gets the default correct resolution is to press s bring project settings and just plug that project setting to that resolution with that if you create constant if you create checkerboard if we create whatever default nuke node that will be brought with the right size format so but again you can always go ahead and change that here as well now with this uh right resolution in place let's throw in a merge node b goes to the background and a goes to the shadow so i'm just going to bring it over here now we don't we're not going to touch the primary and auxiliary passes yet we just want to plug that one into our shadow i need to grab this dot node here move it back to the position now i'm going to zoom in select on the over and switch that to multiply now if i have a look at it i should be able to have my shadow with the right direction the only problem is this robot is way too small another excuse to take it to the next level and use all the valuable tools inside nuke to fix the situation now obviously i need to scale this up and reposition it anything to do with scaling positioning translating is transform so with the with nothing selected actually i'm going to press t drop it in here and i'm going to put scale 1.