Shader Recipes: Rendering Underwater Caustics in Maya

In this series of lessons, we will discuss different methods for simulating the effect of caustic patterns created by moving water. Software required: Maya 2010 or higher.
Course info
Level
Intermediate
Updated
Apr 1, 2010
Duration
21m
Table of contents
Creating Underwater Caustics Using Mental Ray
Shader Recipes: Rendering Underwater Caustics in Maya
Description
Course info
Level
Intermediate
Updated
Apr 1, 2010
Duration
21m
Description

In this series of lessons, we will discuss different methods for simulating the effect of caustic patterns created by moving water. We will begin by exploring caustic photons in mental ray, and how they can realistically interact with a water surface to create refracted bands of light. From there, we will explore an alternative method for simulating caustics which is much more efficient, especially when working with large, open bodies of water. Software required: Maya 2010 or higher.

About the author
About the author

Kyle was one of the first authors for Digital-Tutors (now a Pluralsight company) and has been a part of the team for over 10 years. Kyle began his career in computer graphics education as a college instructor and worked as a Digital-Tutors rendering tutor and curriculum manager since 2002.

More from the author
Maya 2018 Fundamentals
Beginner
11h 21m
Feb 7, 2018
3ds Max 2018 Fundamentals
Beginner
8h 48m
Sep 27, 2017
Introduction to 3ds Max 2015
Beginner
12h 35m
Jun 4, 2014
More courses by Kyle Green
Section Introduction Transcripts
Section Introduction Transcripts

Creating Underwater Caustics Using Mental Ray
[Autogenerated] in a series of lessons will explore a few different methods for actually simulating the effect of underwater caustic patterns within Maya. All right, so the constant patterns that we're going to be creating are the type that you would normally expect to see on something like the bottom of a swimming pool, where we have water at the surface. That's actually refracting the light and focusing it into these small little patterns of light or cost IX. So there's a couple different ways within my that we could actually go about doing this. So we'll explore a few different methods. And as well, we'll start to talk about some of the pros and cons that you can expect to experience with each of these methods. So the first method will explore is actually using metal rate con sticks to generate this type of in effect. So we take a look at the scene that we have currently you can see. This is really just a very simple scene, very simple box with just a plain up top. So what will try to do is actually make this plane simulate the water surface, and then we'll start to add our caustic patterns in afterward, right? So let's go ahead and jump over to the hyper shade to begin with, I'm gonna start over in the mental Ray knows, and for the water surface, I like to start with something like a nice dialectic material. This is actually good for simulating transparent, reflective surfaces like water or glass. Now, once I drop this and I'm gonna expose the output connections for this so that I can gain access to the shading group Now, with this exposed, let's go into the Mayan nose and let's create our water pattern. So good note for this would be something like the ocean. There we go. Now I'm gonna make just a few minor adjustments to this so that it's a little bit more water. Like we'll start with his wave height and just start to bring this up and quite a bit further to the left so that we can start to get a lot more contrast in here as well. I'm gonna start to take this wave peeking attributes. Same as before. I'll bring this up and very far to the left, getting so that kind of starts to get a little bit more of a Peking pattern in here. And then we can also take something like the wavelength minimum. And maybe just start to expand this and bring this up just a very slight amount. Just we can start to see some of these individual waves. All right, so we'll go ahead and just call this good. And now let's take this shading group for this dialectic material. And here in the displacement material, it's just middle click and drop this ocean in here, right? So for the displacement, this ocean is probably going to be giving us some really, really high and strong waves. So we'll probably have to do is come into this color balance and make sure Alfa is Lou. Minutes is turned on. And with that active, let's come in. And now drop. This Alfa gained quite a bit. So that way the displacement height isn't nearly so strong. Right? So now we can take this dialectic material middle click and drop this under your water surface. All right, so let's just see what this does for us. So you could see that does now give us some nice water displacement effects on the surface of this plane. Now let's start to come in and actually add in the Cost IX. Now, as a matter of personal preference because con sticks, you really have to have a lot of photons in order to get a nice clean result. So in order to keep these photons nice and focused, when I always like to do is use something like a spotlight as my caustic photon emitter or even my global illumination photo on a meter. So let's take this spotlight looked through selected, and I'll try to aim this roughly in the same direction that this direction of light is pointing, so kind of right in here and just far enough away to where it is basically encompassing everything. All right, let's go back to the perspective, you. And if we take this spotlight, really, I don't want to interrupt the lighting that we already have, so I'll strictly use this light as a photonic matter so we could just take its light intensity. Bring this all the way down to zero, and we can have totally independent control, though, over the direct light and indirect lighting. So even though the light intensity is zero for the direct lighting. We can still come in and have this emit photons, and the energy that they contain is completely independent, right? So let's tell this to emit photons now you notice the attribute for the caustic protons is still great out. That's because we don't actually have the ability to calculate these constant photons enabled yet. So let's go into the middle ray render settings inside the indirect lighting. Ted, let's pull open the Cost IX and enable that it's all right. So let's come in and see what we have. I could just turn on my resolution gate, try to frame this up a little bit better. We'll see what this does for us and the rendered result that we get. We can actually start to see the Cost IX having some kind of effect, really right now is just a big blown out mess. So a few things we're gonna have to do in order to fix this. The first thing is that obviously, the energy of these photons is way, way too high, so we'll have to adjust that, and then we'll probably have to come in and start to actually increase the number of photos because right now, you can see a lot of these individual kind of blobs in here, so let's start with a photon intensity right now it's set to 8000. This is a value that's very, very dependent on your particular scene size and just how far the light is from the object that's receiving these caustic photons. So in my case, the default value is obviously way, way too high. Let's try to bring this down quite a bit to something like maybe 1000. And now with these constant photons, now that we've enabled this inside the render setting, you can see this attribute now becomes available, and the default value of 10,000 I find is usually way too low. So a good starting point I find is something like 100,000 or even half a 1,000,000. Just because you do need a lot of caustic photons in order to get a nice sharp result, you can see that's actually done a lot to help us. These photons are not nearly as blown out as they were before, and by adding quite a few additional photons cast into the scene, you can see that now that's starting to give us some slightly sharper results, although I'm still really not satisfied with this. So let's come back and maybe start to give it some more constant photons. Right now, we're working with 100,000. Let's bump this up a little bit higher to something like 500,000 and rear ended. This we go and you can see now with more photons were starting to get some definite, sharper results compared to what we had before. Although you will start to notice, though, as you began adding more photons, your rent a time will also start to slow down quite a bit. So definitely be careful with just how high you take this. Another thing we may be able to do with this, as far is starting to get some slightly sharper results is to actually take this caustic radius and start to actually define some kind of a value. Right now it's set to zero, which means that my will automatically try to determine what the basketball you should be. But we can start to do is begin introducing some kind of a value into this now. Ideally, we want this to be something nice and low because what this is essentially going to do is define how far each caustic photon is able to look for any neighboring photons and start to average that result together. We want to give it a low value because we don't want these photons looking in two large of an area, because otherwise we're gonna start to get some soft and blurry results. So I always find it useful to start with something really, really low. And if I need to, I can always gradually start to bring this up, all right, and looking at this, it doesn't really look like that made a tremendous amount of difference. But if we started to introduce even more caustic photons in here, we should even start to get some sharper results. We could go back to our render settings and go back to the quality time. It's just maybe start to increase our sampling level. It's we can get some slightly smoother rented results, maybe rented this from a slightly different angle, and we can actually see the caustic patterns that are being refracted through this water. In my case, the waves maybe a little bit too high, so we could always try going back to the dialectic materials displacement, which is this ocean, and maybe even try to drop this Alfa gain a little bit more. Let's try something like 0.5 And while we're at it, let's go ahead and go into the equality settings and start to increase the rate tracing amount. Right? So that way we can maybe try to prevent any interference from these rays and maybe try to make sure that these rays were able to get back to the camera without any problem. There we go. You can see now those waves are a little more subtle, and it just makes it now a little bit easier to actually see these caustic patterns. So this method that we've just gone through is good. If you actually need to be able to see the surface of the water and actually able to see the refracted cost IX underneath Now, this method is really not so good if you actually have to simulate some kind of a large body of water like an open ocean or something like that. The other problem with this is that because of the number of photons that we have, to use again because we have to use so many photons and concentrate those into such a small area that if we were to try to simulate any kind of a large body of water, it really just becomes almost too much. We just have to use so many photons that it's probably likely the scene won't even be able to render at all. But like I said, for large or rather small bodies of water and situations were reaction to be able to see the water surface, this work just fine. Now what we'll do in the next lesson is actually look at an alternative way of setting up these types of caustic patterns, one that's actually going to be much better used for some kind of a large, open body of water like an ocean.