Advanced Glass Shader in Cycles - Blender 2.8 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello what's up Alexandra here for creative shrimp comm welcome to the new very exciting tutorial in this blender tutorial I'll walk you through the creation of the advanced glass shader with dispersion chromatic aberration volumetric absorption fake caustics and all the right boxes ticked in cycles because yeah cycles is still very powerful but if you'll get started warning to complete this tutorial with relatively low levels of pain you will need a pretty powerful video card but if you dare go ahead now before we get started there are many different algorithms of global illumination path tracing bi-directional path tracing spbm or stochastic progressive for my bank spectral rendering stuff each one of these algorithms has its own pros and cons and there is no silver bullet but because we're going to be dealing with the glass shader in particular it is important to pinpoint some differences between those for rendering algorithms in two areas especially caustics and dispersion without going into much technical details let's just say that cycles is pretty bad at caustics because it's a classical path tracing renderer so it's just a limitation of the architecture other algorithms like spbm are intended for high quality caustic work so for example apple seed and yeah for a excel in this department again there is no silver bullet and cycles is great in many different situations like rendering exteriors the great caustics is just beyond its feature set for the moment alright and another crucial feature of the glass shader is light dispersion or chromatic aberration when the light ray passes through the transparent medium it gets separated into its components red orange green and so on again the vanilla path tracing algorithm is just not very good at reproducing this effect to be able to simulate it properly you would need a spectral rendering solution like Lux render for example so these are two important features of the glass shader that who don't get in cycles for granted but the good news is that we can try to get around some of these limitations and cycles so keep watching let's get started by setting up blender if you want to get straight to the glass you can skip to approximately the 8 minute mark okay and another quick note that I wanna mention is that your blender interface might look a little bit different if you want to get the exact same interface just like you see here then follow the link in the description to download the project files alright so here we have blender 2.8 alpha version I created a bunch of spheres and if you enable the wireframe mode and maybe crank up the opacity of the wireframes you will see that we have here three monolithic spheres and here we have a sphere with the solidify modifier it means it's no longer monolithic it has walls and these walls have some thickness here we have a sphere with the solidify modifier as well but the thickness is much lower and here we have yet another sphere with the solidify modifier one tricky thing that in my opinion is worth mentioning is that within the center of sphere we have a hemisphere surprise and if we take a closer look at this hemisphere we will notice that it has a weird kind of n-gon at the top and this engine produces a weird normal shading but I liked the way it looked so I decided to keep it okay so what's the point of having such different objects with variable thickness and stuff like that this variable thickness will help us to preview the shader under different conditions which is pretty cool all right I'm gonna name this material glass or rather uber glass super advanced underscore zero one right off the start we have the principal psdf shader created for us and let's get over to the render settings make sure that the render engine is cycles and underneath the viewport let's press this button that means the cycles viewport rendering also I will come over to the viewport settings once again and disable the overlays so here we have the principal psdf shader and it's very tempting to just increase the transmission all the way to one basically that means that the material will start transmitting light rays and technically speaking this is a glass shader already but before doing anything else I was like the background object and changed its material I will assign a dark gray color reduce specularity and hopefully that who make the glass objects stand out then I will jump into the world settings click on use nodes that will create a basic environment for us and we can see some reflections already that's cool what we can do now is for example reduce the roughness to zero and that will mean absolutely perfect glass now it's a good time to tweak some render settings because we will be using the cycles real-time viewport for the rest of the tutorial we wanted to bit fast let's crank up the viewport samples to 2000 and in the max bounces I will set the total number of bounces to 8 to limit the total number of bounces a little bit glossy - for transparency - 8 transmission samples are pretty important I will set it to 6 because we have many refractive objects and now I will disable caustics reflective and refractive caustics all together that's very important because we will be simulating or rather faking Cossacks ourselves alright we have the GPU compute set in the device settings assuming that we'll be using the video card for rendering and in the viewport settings I will set the start pixels value to 512 because look at this if you leave it at 64 will see that as noise attack at the start of every viewport move and stuff like that 512 helps to mitigate this issue a little bit and in the world settings the sampling is set to manual max resolution to 1024 and I think that's it for the render settings the next thing on our list before we actually move on to the shader creation is adding the hgri environment let's come over to the world settings in the material tab and add the environment texture to connect it to the color sort of the background now choose the HDRI texture I will pick the abandoned games room from the SGI heaven by Greg Zhao it's still one of the best resources when it comes to free HDR ice recommended okay so I've added the mapping node as well and the texture coordinate node drag the generated output over there now we can try rotating the edge or right to find the best looking light angle so two two two two I think two hundred and sixty degrees two works really well because it wraps around the object in this case and it totally makes sense from the visual standpoint because loops good placing the most limited part of the SGR eyes slightly above the objects okay in the color management settings if we set the view transform to default and for example increase the strength of the environment all the highlights will be clipped so I will switch to filmic because it's just much better solution for working with high dynamic range data and obviously glass is a very reflective material so we will see the reflections of the HDRI environments very hard highlights very hot all right I'm gonna add the RGB curves as well because I want to increase the contrast of the environment and I think we're good to go let's go back to the object mode in the material editor and make the background plate even a touch darker I really want our the glass to stand out from the background okay as I've said now the principle be SDF with such settings behaves just like the usual glass shader no difference whatsoever but in a moment we will try something very different we will try reconstructing the glass shader from the individual components like refraction then reflection on top of it and so on so buckle up that will be exciting especially if you haven't done that before the first building block of our advanced glass shader will be a refraction and dispersion so let's drop the refraction shader into the material editor let's connect it to the surface output what it will try to do in a moment is create the separate red green and blue refraction shaders and then combine them together that will hopefully allow us to achieve the dispersion effect okay so here we have the index of refraction parameter this parameter defines how the light is bent upon entering the refractive medium the usual index of refraction for glass is about 1.5 and for acrylic glass is a little bit lower for water is even lower for air is one all right and if you try to weaken the thickness of the solidify modifier you will see how it kind of interacts with the refraction that's why we have objects with different thickness now let's add the value node and plug it into the color slot of the refraction shader yeah that's volume not a color so what are you doing lab because we can do this we can go beyond one beyond the white point all right we can do the same with the RGB nose but that is a little bit more convenient for me to work this way so I added the mix RGB node I will switch it over to the color mode and look at this now we can colorize this value what I'm going to do next is make this first component just pure red I will set the green and blue channels to zero and the red channel to one and here we go after that I will crank up the mix factor to 1 and here we go we have the perfect red shader let's the mix shader' now and copy out these nodes you can press B to invoke the selection rectangle then shift D to duplicate connect it to this second input of the mix shader' now drag it over there right into this surface shader output the color of the second refraction shader will be pure green and the mix factor between these two is 0.5 if we go all the way to one we will show just the green shader all the way to zero and the red shader will pop up and 0.5 is just a 50/50 mix after that I will go input geometry and drop the geometry node over there we will need the normal output let's hook it up to the normal input of the refraction because they have that's important and here I want to say thank you Carissa for helping me out to understand these nodes and stuff it was really helpful now place that makes RGB node in between select the blue color and now it's very exciting we can bend the normals that go into the refraction shader we can multiply it with some microscopic value like zero point zero five zero point zero seven something like that and look at this we kind of shifted or bent the refraction of the first shader and the fringe in effect showed up I think that's wonderful that's exactly what we need for the dispersion shader okay I'm going to add the value node to make it a little tighter and you can press ctrl H to minimize any node to only the active output that's very convenient okay value about zero point zero zero seven plug it into the mix factor and the crucial thing is not to overdo this effect just I'm trying to keep it very subtle okay I'm gonna copy all the normal shenanigans over there whoo get up to the normal of their refraction BSD F of the green shader now I'm gonna type something like zero point zero fifteen to make it more obvious you can go even further if you like but in the end it can make glass appear a little bit blurry so I will stick to zero point zero fifteen for the moment press b for tangle selection shift T to duplicate all these nodes that'll be the third shader but now we need to copy the mix shader' as well and drag it over here and this one over there that will be our blue component so let's head over to the color select pure blue and reconnect the last mix trader to the surface output but look at this it seems that something went terribly wrong the shader is way too dark and too oversaturated I would say the assertion that I found is that we can crank up the value of the third blue shader we can take it as high as for example seven that'll create an absolutely weird effect and sometimes it seems to me that I don't know what I'm doing but we can go over to the mix shader' to the last mix shader and take the factor down to 0.1 something like that but come on now it's like crazy dark what should we do don't worry just yet we can fix it I promise let's go over to the blue color and desaturate it a little bit and don't ask me why it helps surprise surprise we have wanders into the territory of pure blender shenanigans at last at last so we can also do separate the green color a little bit and you can see how things are improving and desaturate the red Channel as well the tricky thing here is to make sure that the color of the glass is neutral like neutral gray I think it already looks pretty cool pretty neutral and if you zoom in you will see the wonderful fringing effect you can go crazy with shifting the individual color channels for example you can take the blue shift all the way to 0.1 and see what happens but I would recommend to keep it subtle and you can see that inside and outside the sphere we have the same shade of gray and we didn't break the energy conservation law Wow let's now go to the user preferences add-ons search for node Wrangler and enable these add-on we'll need this add-on for a very cool preview functionality you can hold ctrl shift click on the node to preview it for example here is our red shader then how control shift click on the make shader and yet now the mix shader' you got the point and now what we can do is for example creates our the refraction shader to compare our shader to it and to make some tweaks based on the new information ctrl shift click on these click that see the wonderful chromatic aberration effect well that I would like to tweak the tone of the glass a little bit yeah I think now it's really neutral and especially in the higher contrast areas the effect of separating different wavelengths of light ray really shows up the fake effect I should have said but who cares as long as it looks believable it's the neverending debate of physically correct versus physically plausible right what I'm gonna do now is select all these nodes press shift P to automatically draw a frame around them that works only if you have the node Wrangler don't enable it once again and now I'm gonna make the label a little bit larger so we will be able to see it clearly because you know ten minutes later our advanced glass shader will look like absolutely horrifying spaghetti monster we will need some clarity okay cool the second component of our shader is reflection so let's add the mix shader' drop it over there then press shift a shader glossy psdf and drag it over there so now we have two main components refraction and reflection in place we just have to mix them in some particular way because right now refraction is kind of overpowered by the reflection and a glass should behave obviously like the electric not like metal so let's add the free nail node and plug it into the mix factor this is known as the geometry of the object to the black and white gradient based on the angle from the camera to the surface point so basically all glancing angles will be white and we can also plug the color ramp node afterwards if you really want to play with the angle and fine-tune the Friel effect see now the reflection only appears only glanced angles which is pretty cool but you know what I will delete the color ramp shift PE to create frame around these nodes and to open the right tool shelf let's call it a reflection and you know what I have a feeling hmm but first let's compare it with a glass shader with the regular glass yeah I have a feeling that I made a mistake and I will try to explain it in a moment basically well the bare Finnell looks pretty nice with the help of the color ramp you would be able to fine-tune it more carefully so this is a usual glass shader pay attention to the edges and this is our shader with a combined refraction and reflection and some dispersion this person works great here we have no such effect but on the other hand take a look at this dark outline going around the sphere when you try to mix the reflection in by using the friend L node without any adjustments you will inevitably get a such outline what we can do to mask it is well use color ramp node to tweak the mix factor between reflection refraction a little bit see how the white flag the highlights has been moved to the left and the additional stop the gray flag has been added in between and while we have the same free Neil effect with the same index of refraction in place by adjusting its contrast we remove this gradient yeah that's definitely some worth noting now let's get back to our material nose and see what we have so two blocks first one being refraction plus dispersion and the second one reflection now it's time for yet another component which is subsurface scattering and a touch of translucency but first let's talk about muting nodes you can mute nodes like this and unmute them like this or you can hit em to mute em to unmute the simple tools like this go a long way especially when you have to deal with spaghetti monsters of any kind okay let's add the odd shader and then the subsurface scattering shader with this shader we will simulate our the effect of the light trapped and scattered inside the medium because of some micro bubbles and stuff like that but first I will add the geometry node and also the normal node and I will hook the normal output over there and connect the dot output to the color input of the subsurface scattering basically I want to control where the SSS effect appears on the mesh for example I want to make sure that only the top or bottom portion of the mesh gets the additional scattering effect going on that's why we added the normal node and the color ramp is just the contrast and to make the effect slightly less in-your-face I will reduce the brightness of the right flag actually it will be a very very subtle effect just a little bit of diffusion going on I can barely visible mist you know inside the class you can even add some tint to it as if there are some irregularities within the volumetric glass texture that bend the light spectrum a bit and to make it even more complex and obscure I will go ahead and add yet another mix shader' then shift a translucent psdf that translucent psdf within blender works in a very similar fashion to subsurface scattering it permits light to pass through but diffuses it just like frosted glass for example right now that translucency really overwhelms everything else so I will set the color to dark gray and will reduce the mix factor to some 0.1 number let's now zoom in to see it more clearly look at the edge of the sphere translucency adds this milky effect to the material of the sphere so here we go that was our sss + translucency block for the time being though I will just mute the odd shader to reduce the strain on the computer because this is a quite demanding shader but you know we will enable it just before hitting the final render ok awesome now it's time for implementing the absorption component let's start off with pressing shift a go shader makes shader as usual see you we're back on track we no longer use the add shader because the add shader is really not physically correct at all alright so what I did here is out of the standard glass shader and let's give it a heavy tint for example let's make it a bluish color or no let's make it look like a cognac because it's much more fun the point is to make it look like some big portion of the spectrum is absorbed and only the Reds part of the spectrum comes through and to make it happen we need to use some math at first I saw this technique I think it was the article by Gottfried Hoffmann it was wonderful so we need the back facing attribute from the geometry node multiplied with the Ray length attribute from the light path node Godfrey tree created some real absorption formula we will stick to just fake solution that works just as well I claim well maybe slightly worse and by the way I replaced mixed RGB with math no just for the sake of clarity so let's multiply back-facing with the Ray length clump the results are the color ramp node on second thought clumping them multiply node isn't really required because color ramp will output the values between 0 and 1 anyway but right it doesn't really matter here the color ramp will serve as a way to control the effect in terms of simple visual manipulation with flags so we hooked it up to the Max Factor and that made the thick areas reveal the second shader the cognac shader and by the way just a friendly reminder inside central sphere we have a hemisphere occupying the lower portion of the mesh that's why we see lots of absorption here all right I pressed ctrl H to collapse is node to show only the active output and here I will plug-in the hue/saturation Valley node and increase the value that is another purely perceptional tweak not physically correct at all but anyway we achieved a little bit of absorption based on the length of the rate raised by cycles the Ray that penetrates the geometry and reveals the second shader works pretty darn well and for the color of the tinted glass we can use the same trick that we used before we can have a value that is greater than one then use the mixed RGB node switched into the color mode to colorize this value maybe at some point would like to make it look like a dragon blood so glowing actually how does the dragon Baluch does it shimmer in the dark does it have a golden tint maybe doesn't break the energy conservation though I think it would be a shame if it's physically correct I shouldn't be anyway what I really love about the absorption effect is that it's dynamic if you try scaling up or down the object you will see what I mean by scaling up and down the fear you will change the thickness of the glass and this you will change the ratio between these two shaders that's very intriguing like you get a color variety for free if you have many different types of objects rights next we'll tackle fake caustics this is I mean caustics is a huge pain in unidirectional path tracing engines like cycles just due to the architecture of the algorithm especially the refractive caustics of course if you turn it on in cycles you will either have to wait for a long long time for caustics to converge or you will have to use denoising that actually has an enormous potential I think but still sometimes it's just better to take control over the situation and fake caustics altogether that's exactly what I'm gonna do now so let's go ahead and add the mix shader' then the transparent shader we will use it for only yeah we will require yet another light path node we have already used it for for the absorption but this time we will use yet another output of this wonderful node namely the is shadow ray output will plug it straight into the mix factor let me unpack it really quickly is shadow ray means that for all the shadow Ray's we will switch to the second material which will be the transparent be SDF with some twist [Music] what was that goddammit to put it bluntly we will boost the luminosity value of the shadows beyond the physically correct value to make the shadows appear brighter than the light actually hidden the object which is obviously insane but that is a short cast to the fake caustics so let's go ahead and add that geometry node then throw in the vector math node we will need yet another geometry node what we'll do next is connect the normals over there and the incoming out of there what we would need is the dot product I have no idea what I'm doing it's like magic that blooms only in rare souls we also need the color ramp and we have to invert the colors like that compress the range like that drug everything into the transparent psdf node and to reveal the effect finally we will need to multiply it by two or something like that I guess it depends on the scene but 1.7 seems to be working pretty well notice the beautiful absolutely fake caustics but you know what we need a few more flags in between to add some more definition to add some details into the caustics texture again it all boils down to some imaginary irregularities within the glass and that's a good reason to use the tricks like that let's add the area light just for the debug purposes right so now the shape of the shadow is pretty evident Umbra penumbra all that stuff hopefully that will make it easier to tweak the color ramp to change the shape of caustics so let's go back to the node editor by simply selecting the glass subject I think it looks pretty cool but I don't really like the overall opacity of the shadow I want to make it a little bit more transparent so I will go ahead and tweak the right flag to the point of neutral gray color as if the glass material simply permits most of the light passed through without standing in the way it sounds like this yeah that looks good to me now we can delete the light source the debug light source wipers X gone and what is wonderful about this technique is that the shape of caustics kind of interacts with the environment because as we remember under the hood is just a shadow so look at this do you this illusion can trick the untrained eye I think definitely mm-hmm so what can we do to make it a little bit more interesting and believable let's go to the object mode of the material editor what I'm going to do next is spice it up with some procedural noise as a sort of colorization mechanism because right now the caustics is uniform despite the fact that the glass is multicolored that does make sense so let's throw in the mix RGB node switch it to the orange color set the mode to color and the noise shader will be plugged into the mix factor hopefully that will allow us to break up the uniform look let's select the noise texture press ctrl T to add the texture coordinate and mapping node again you need the node Wrangler done to be able to use this hotkey let's also include the color ramp node in between the noise texture and that makes RGB now we can play with the contrast and maybe shift the coordinates in the mapping node can press ctrl shift and click on the node to preview it what I'm trying to do here is make some areas of the marriage give the orange tint to the shadow rays passing through based of course on the noise texture as a mix factor I think this cognac shadow already looks pretty darn convincing I love it let's take it a step further let's press shift T to duplicate all these noise nodes let's also grab the mix node shifted each duplicate drop it over there switch it into the mix mode the idea behind this shenanigans is makes everything with black by using the noise texture as a controlled texture to be able to influence the overall pattern of caustics in the scene if that makes sense I hope does make sense alright so to sum it up we have two noise textures on top of our initial fake caustics effect the first one for colorization and the second one for controlling the overall density or rather strength of the caustics probably we could have gotten away with just using the initial setup for caustics without any noise shenanigans but on the other hand now we have the ultimate control over the process so that was worth it in the end we have to do it only once and now you can copy/paste this setup across the different shaders and even across the different scenes your mind must be blown keep yourself a second got here alright so we have already assimilated the Vil Marik absorption but we also have the real physically correct volume and the volume bounces are set to zero that's alright because the bounces beyond zero can be really noisy okay so let's add the volume scatter and the volume absorption shaders we need to combine these shaders together with the help of the odd shader of course we can reduce the number of steps and just use the new principled volume shader added to blender 2.8 alpha maybe I'm a little bit old-fashioned I still prefer vellum scatter and volume absorption combo you can already see that we added some smoky look to our shader and usually the density parameters of these two shaders are interconnected so we can just plug one value into two density inputs to control them simultaneously like this we created a group with Silent Hill inside apparently and we can do the same trick with the RGB node we can use it to drive the colors like this but actually what I want to do is disconnect all of this and control the color separately so the blue steel for the scatterer effect and the orange tint for the absorption say let's keep pushing it into the amber direction into the cognac direction if we bring up the density of the absorption and the last material will become more and more opaque that may or may not be what you want so I will stick to some modest value like one and I'm gonna tweak the scatter density as well let's say zero point seven works pretty well I think it's just a little bit of fog and before proceeding I would like to warn you because the volume shaders take a long time to render sometimes it's wise to just disable it altogether and enable just before the final render okay what's next next is roughness because it seems to me that we nailed down all the major components of the advanced glass shader like absorption fake caustics reflection subsurface scattering refraction and dispersion yeah now we need to figure out the right way of setting up the roughness texture first I will add the image texture and then press ctrl T to auto generate the mapping node and the texture coordinate node with the help of the node Wrangler Adhan I will use the generated coordinates instead of the you the coordinates now we're going to hit open navigate to my folder with one texture which is this hexagon texture that I downloaded from pixabay I will click on the flat and select box instead as a projection mode that will just project this texture from all directions and to eliminate the seam I'll bring up the blend parameter and finally I will add our beloved colorramp node we're gonna be dealing with the roughness texture right so black will mean zero roughness and white will mean the roughness of one now we need to preview the final shade or somehow so let's navigate to the right end of this note spaghetti and get back over there let's connect it to the roughness and put but everything is so painfully slow and that's because we haven't disabled the volume shader and it slows everything down okay so we disconnected it and now it's a lot better at least we can connect to the texture and the shader and that's something so what we will do next is hold shift and drag across this line to create this reroute point that will hopefully help us to organize this whole thing in a visually clearer way because now we need to find all nodes with the roughness inputs and we need to connect this reroute point to these inputs so we here we have the glass shader and on the Left we have the reflection shader and three refraction shaders red green and blue so I'm creating a bunch of different reroute points all across the board I'm going all in with the rerouted porns building this architecture to make it visually readable because otherwise it will be a total mess and when we are done with this basic setup we can actually proceed with tweaking the roughness texture the color I'm here is like the endpoint of our tweak chain and this is precisely where you define what type of glass is your glass is it an acrylic glass is it the frosted glass maybe it's an eyes what anyway this is a crucial parameter of our advanced glass shader we do it last but it's not the least important okay what I will do next is control-c control-v to copy-paste this set of nodes that we use for the roughness texture and let's use it as the displacement texture or rather the bump texture look at this oh god damn it what a mess actually it's interesting I find it very appealing but that's not what I was aiming for let's turn the displacement method to bump only who set it to displacement let's now jump back into the psychos viewport rendering mode and it looks awesome but here is a trick what we see in the viewport is oftentimes miss guiding a little bit just trust me it's easy to overdo the bump map let's tone it down right away first I will reduce the contrast of the color ramp and as the second measure I will go shift a converter math click here select multiply so what I will do is multiply it by 0.1 so effectively I will divide it by 10 and that will reduce the intensity of the bump tenfold or even let's take it further down may be 0.011 render it will still have a very pronounced effect especially combined with the roughness map so yeah let's keep it at 0.01 right awesome we have all the major boxes ticked now we can try implementing a speed-up hack we don't really have to do it but in some cases it may come in handy so let's take a look at how it can be done first we have to introduce yet another mix shader' and we will be mixing it with the transparent shader and we will be using the light path node once again I saw this trick in the gemstone tutorial by Anthony Pilon so it goes like this let's add the light path node convert her math node now we need to compare two types of rays the shadow ray and the reflection ray set the mathematical operation to maximum basically it will output whichever value is bigger and then we'll need yet another mouth node and drag this output over here but this time we will compare it with the Ray depth essentially the idea is to switch over to the transparent shader for the reflection bounces that are greater than a certain value so we need to introduce yet another math node the operation should be set to greater than and now we just need to provide some value and the value node may come in handy in this case so drop it over there this will be our number of bounces and we will tell blender if there a depth the number of bounces are greater than four then switch over to the transparent shader well something along these lines because I cannot fully wrap my head around this concept but anyway it works for example we can set it to and that'll mean that for every reflection ray after the second bounce we will switch over to the transparent shader that definitely helps to reduce the amount of fireflies they over all levels of noise but obviously it messes the shader it's no longer the physically closable glass shader it's something like the transparent shader with a bit of reflectivity but if you are in a really tight situation you can try implementing this hack but from now I will mute the mix shader so I will disable this speed-up anyway I think our advanced glass shader is pretty optimized on its own we kind of faked everything already next before we hit the render button it's time for some final tweaks so let's take a look at what we have done here is our final shader looks spectacular we started off by simulating dispersion by combining three different refraction shaders red green and blue then we layered some reflection on top of it it's just a usual glossy shader after that we added some translucency and the subsurface scattering effects it is disabled at the moment and also we added the absorption based on the rail length after that we plugged in the fake caustics effect based on the transparent shader and is shadow ray known as a mix factor implemented a need speed-up hog that we ended up not using spiced it up with the bump map and the roughness map and also the volumetric shader volume scattering volume absorption that went straight into the volume input of the material now let's go through all the nodes once again and enable all bells and whistles before hitting the render button okay so the speed-up no thanks what we have here is caustics let's enable it let's unmute the node again what about the render settings I don't see any reason for the glossy bounces to go beyond two or maybe three the transparency bouncer should stay high and what about the transmission bounces it's a little bit tricky because if we ever optimize it we will lose the essential qualities of glass like the light race will no longer be able to pass through the light and that is ridiculous but maybe you're aiming for this effect so go ahead in this case I guess alright cool before actually rendering the image I will enable burn into image in the metadata tab that will make the render time and other statistics into the image okay the resolution is set to 1080p and how much time for render hooray it can take a considerable amount of time but the test render is obviously not that bad three minute and a half it looks remarkable but we still see lots of noise ad that is a normal thing it's totally expected and who we can try to balance it to some extent by using two noising so go ahead and enable two noising and I'm gonna set the radius to five and both strength and future strength to 0.25 that'll make it a little bit less smooth and less destructive in my opinion and now let's switch to the render slot number three hit the magical f12 button now we will see two types of render buckets clearing the screen for us the first one is just the path tracing bucket and the second one is the denoise in bucket now the render time will be a little bit higher 338 versus 327 but considering that the image now looks way more smooth I think it's totally worth it it's especially cool that the denoise an algorithm killed the multicolored hot pixels so-called fireflies that otherwise would be so hellishly hard to deal with and now after we are done with rendering this stuff we deserved a little bit of compositing it's just a way of relaxing after the work done and getting some gratification back for example let's add some glare that's a no-brainer just works so well with the reflective and refractive materials the glare helps to reveal and emphasize I would say the areas with the highly minus T values it works so well with the glass material and we can have the lens distortion on top of it and increase the dispersion value and it's pretty ironic we spent like half an hour built in this shader and we can just use this node in the compositor and bam but no no our lens distortion is much better much more sophisticated keep telling it to yourself mm-hmm but maybe we can add just a little touch of the lens distortion in the compositing as well I would say if we enable the projector mode and not overdo the dispersion like if we said to do 0.8 it will turn to mess so let's keep it lower yeah I think it looks alright it helps to smear the noise further more so it makes a nice combo with denoiser it's like an additional denoise in pass it looks great alright folks I think that's it the last thing that I will do is set the render samples to 1024 if I had to do the final final super final high-resolution final render zero one I would have set it to even higher value it all depends on how far you wanna stretch it and yet another possibility of reducing the render time is to use the branched path tracing algorithm branched means that we can treat the different types of light rays separately for example we can crank up the number of transmission samples and that totally makes sense in this situation because probably the 90 percent of the noise comes from the transmission race but I don't want to go in this direct so I'll switch back to the classical path tracing alright and that concludes our uber glass shader tutorial for blender I really love the final result I think it looks awesome here you can see some additional test renders that I made using this shader and if you want to play with this shader feel free to download it I included the link in the description below the video just follow the link to download the files and have fun thanks for watching let's eat I hope you enjoyed the tutorial that was gleb Alexandre for creative shrimp comm to learn more I would recommend you to check out real spectral rendering engines like Appleseed or looks render it has a plugin for blender so feel free to check it out and also there is a wonderful thread on blender artists about integrating some kind of spectral rendering solution right into cycles it's a very clever hack and it's very promising drink more coffee and will change the world of computer graphics and now I should have shown you some amazing animation so I will orchestrate it for you in real time using pure f magical tool yeah that's it
Info
Channel: Gleb Alexandrov
Views: 181,478
Rating: undefined out of 5
Keywords: blender, blender (software), tutorial, cycles, glass, shader, material, free, raytracing, path tracing, realistic, photoreal, textures, blender tutorial, creative shrimp, caustics, dispersion, chromatic aberration, prism, spectral, refraction, absorption, volumetric, real
Id: 1p7l9MNpLdo
Channel Id: undefined
Length: 45min 39sec (2739 seconds)
Published: Thu Nov 15 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.