Renderman 23 Orange Juice Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello michael here from small robot studio with another renderman 23 tutorial today we're going to be having a look at how to render a glass of orange juice we're going to use a little bit of subsurface scattering here and we're getting into how nested dielectrics work which is something that i've omitted in the past i've already got some geometry set up here but for the sake of this tutorial i'll just quickly explain what we want to do here so i've got a cylinder here and what i'm going to do is just quickly create a glass for our for our juice so i'm just going to extrude all these faces inward so it gets to about the bottom and i'm just leaving a gap as you can see between the edge and then what i'll do is just create some edge loops there and then on the inside and on the outside okay so we've got a glass that's pretty straightforward and now we're going to create another cylinder i'm just going to turn off my cap subdivisions for this one and again i'm going to add in some [Music] edge loops to the top and the bottom so when it's smooth it looks something like that but i also i'm just going to pick that middle vertex and extrude that and i'll just move that back down so it's parallel with the top and then i'm going to select that edge loop move it out and then i just want to get that outer edge loot and move it up and basically what i'm trying to create here is a bit of viscosity for the juice because liquid sort of adheres to the outside of the glass a little bit so we just want a little bit of a sort of ramp occurring a bit like that but i'll just smooth it out a bit okay so something like that now in my um one that i've made already i've actually got it with quads but which will subdivide better than this as you can see these tries aren't very good but um for the sake of time and expediency i'm just gonna do it this way uh patrons will just get the assets obviously as they always do um so this is the juice here so we're just going to call this juice geo and then we'll call this cup geo and what we want to do here so this renders correctly is if i just jump into the side view the juice which i've got selected needs to have its outer wall between the outside of the glass and the inside of the glass so those that line there and that line there is the outside of the glass and then the interior wall of the glass and this intersection is what makes the refraction through the glass look correct so what we're going to do here now is just grab those top vertices and move them down and that should work for our glass of juice now i've already got a light in the scene render settings are all standard at the moment so if we just render now it should just look like gray okay so the first thing we're going to set up is our glass very straightforward picks our surface shader and we're going to call this glass and it's got toot and we just want to remove the gain for the diffuse channel and then refraction and reflection to 1.0 and the glass should have an index refractive index of 1.33 from memory so that's the easy part now the juice is the hard part so what i'm going to do here to visit of this is that lip might be a bit much but we'll see how it looks i might have to smooth that out a bit um yes it's actually definitely too much okay it's just that outside edge loop needed to move down that's better so we're going to do the same thing here i'm going to assign a pixar surface shader to it and we're going to remove the diffuse gain and for the juice what we're going to be using here is single scatter which is a pretty cheap way of doing subsurface scattering and i'm just going to jump into the hypershade editor i'll bring it up over the top here so that's this button here and then we're just going to rename this to be called juice and what we're going to need is specularity so i'm just going to increase the specular face color to white and the roughness offset to say 0.1 then we'll move down to single scatter and we'll increase the gain to 1.0 if we render it now we'll see that we get something that actually doesn't look too bad at the moment honestly it kind of looks like um guava juice or something it's not what we're after though we're after orange juice now orange juice actually is a bit of a misnomer because it's actually probably closer to yellow to be honest so we've got two options here we've got the uh color which is a single scatter color and then the mean free path color which is the darker color that you're seeing there so we're going to change that darker color to be a sort of a darker yellow if we render that you can start to see that pretty much as getting there as it is so the singles the scatter color can be white and it won't look too bad you can sort of add in a bit more yellow if you want but just watch how much darker this gets i do have denoising on so it's not denoised and that is denoised you wish to turn your denoising on just make sure you go into aovs beauty and select denoise now this is a very consistent color though so to improve that to give it that sort of cloudy look you could either affect the gain with a noise pattern or you could affect the color with the noise pattern and when i did the setup for the previous one i just used color and i think that's probably a cheaper way to do it so we're just going to use a vora noise here which is a pxr voronois and we're going to run this into a blend and we'll just increase the frequency and then we'll run the rgb into the top rgb and set this to multiply and then we will set the bottom color to our very light saturated yellow color and then this is going to be our color for our single scatter input so we're just going to run the result rgb into the top input here so we can select single scatter color now when we ipr we should see a little bit of change there so we can see some cloudiness if i just compare the two so if you wanted like a more like you know you can get juice with pulp and stuff and this is sort of what we're going for here um i would say that this is probably a bit too dark like the the difference between the lightest value and the darkest value is a bit too high so we probably want to clamp that we could also do it with a color offset so we're just going to bring this color offset and alvaro noise up and now it's a lot more subtle if you compare the two there definitely there but not as obvious as it is there now um to show you more of the subsurface scattering we'll add a straw in um actually a subscriber or i hope they're a subscriber but a commenter um mentioned they were trying to do this and i thought oh yeah i can do a tutorial on this so we'll chuck a straw in there all right just using the side view there to line the top edge up there and there and that should be fine and i'm also just going to delete those end caps quickly and i'll also give that a material which i'll just make look plastic by giving it a white actually let's not make it look plastic we shouldn't be using plastic straws i'm just going to use a grayish color maybe slightly brown because we should be using paper straws shouldn't we okay so now what we should see is the straw uh entering and because of the refractive index of the substitute scattering sort of being offset there but we should sort of see it disappear a little bit into the glass or into the juice the glass is not apparent at the moment and that's because of the way the sub scattering is working okay so now that we can see the straw through there let's talk a little bit about the mean free path color and how it'll affect the translucency of your liquid so essentially what we've got here is a fairly opaque liquid as it gets towards the bottom or as it gets to be more material between the camera and where the straw is in the glass so if we increase this to 20 you'll see that it becomes more translucent i'm seeing it's a lot thinner essentially whereas if we reduce this side to two instantly you'll see that it's quite a bit thicker there is another method that we can see me use to control this if we change it back to 10 and we can adjust the directionality so this is just sort of for fine tuning once you've got your mean free path kind of close to where you want it essentially as we bring this to the right the directionality you see that darkens the backside whereas inversely it sort of thickens the front side so i'm pretty much going to leave it as is but this might be something you want to add if you're getting close but you just need a little bit more um towards the back side of where the light's coming from essentially so 0.05 now you may or may not think that looks too thick it's up to you as to how thick you want the juice to look i like my juice with pulp so this looks good to me so we'll add the glass back in and we'll discover our very first problem so you can see that our lovely orange juice has now turned into that disgusting green liquid that people tend to drink and we don't want that because orange juice is much tastier so we need to change something here and what's happening is we need to adjust the intersection priority and that's because of the method that we're using with this liquid intersecting the glass the renderer doesn't know what to prioritize with the ray bounces so i'm not going to go too far into it it's actually described pretty well in the docs and there's a white paper that you can read as well if you wish but essentially what we want to do here with intersection priority is always start from the glass and then work your way inward so you could say the glass and then the liquid and then finally if you had ice something like that you could add that as the third so priority works as the smallest number being the most important i'll just delete the history from both of those so i don't have to see all those tabs so we're going to select the cup geo tab and then we're going to go down to render man and you'll see the intersection priority is set to negative one infinite that means it is the same priority as the juice which is also an uh intersection priority of negative one so we set the intersection priority on the glass to one and then we set the intersection priority on the juiced two now you can see compared to our disgusting green liquid we have some lovely juice with the correct intersection the correct refraction as well all right and there we go with the ground plane placed in the scene there you see that we've got a lovely straw which could probably do to be a bit bigger i think and we've got our liquid refracting our light and intersecting correctly with our glass shader as well so hopefully that's helped anyone out out there that's looking to do this as i said patrons will get all the assets from this tutorial as well as a couple little bonus oranges i think i'll throw in there as well so um yeah until next time i'll see you next tutorial that's it for this tutorial if you found it useful make sure you leave a like so other people can find it and if you haven't already make sure you subscribe as we're bringing out cg and illustration tutorials every week just like this one become a patron and access tutorial assets bonus content a private discord and more by clicking the link below
Info
Channel: Small Robot Studio
Views: 2,530
Rating: undefined out of 5
Keywords:
Id: G9p7mhjyRp4
Channel Id: undefined
Length: 12min 14sec (734 seconds)
Published: Tue Dec 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.