Learn how to create an ocean shader in Cinema 4D.
Software like Realflow is expensive and time consuming to learn, and you're not always going to have the time or budget to learn a brand new piece of software for a project. In this lesson you're going to learn how to make an ocean shader from scratch. You'll gain a TON of knowledge about how shaders work in Cinema 4D that you can use to build your own custom shaders. You'll also learn how to animate waves procedurally so you won't need to use a ton of manual keyframes on something as complex as an ocean. We'll even attach an object to those waves to get it to bob up and down, just like it would in the real world. There's a lot to learn in this lesson, so grab your notepads and pay attention!
Tutorial Full Transcript Below 👇:
Joey Korenman (00:00:17):
Hey there, Joey here for school of motion. And in this lesson, we're going to take a look at how you can make something look like it's floating on an ocean without needing anything more than the built in tools that Cinema 4D has to offer. This lesson is about being clever with the existing tools. We'll take a look at how to build a custom ocean texture and then get some texts to float on the surface. Like it's riding the waves while this may sound a bit complex. If you hang in there by the end of this lesson, you'll learn a bunch of new skills about texturing rigging and animating that you might not have known before. Don't forget to sign up for a free student account. So you can grab the project files from this lesson as well as assets from any other lesson on the site.
Joey Korenman (00:00:56):
And now let's jump into Cinema 4D. All right. So here we are in cinema and a, the first thing I'm going to do is show you guys what happens normally when you add, uh, the scenery plugin. So, um, if you're not familiar with it, it comes with a bunch of presets and setups for you. So I'm just going to add a sunlight setup and I'm going to add the, um, let's just go with the blue sky, ocean preset. All right. And, uh, so by default, um, when you add those two, those two objects, um, this is the result you get. All right. Um, and anti-aliasing has turned to low. There's no GI there's no, uh, ambient occlusion, but you can see you've got a pretty decent, uh, ocean here, you know, and you've got some nice reflections, um, and the lighting's nice and with a little tweaking, this could be a very usable, seamless ocean environment.
Joey Korenman (00:01:55):
All right. Um, now here's the problem. And, and a reason I've been getting a lot of emails, uh, let's say you want something to actually be floating in the water. So let's just take this type and move it down into the water and do a render. Uh, now you'll see the reflections and everything is still a great, the problem is you are getting a perfectly straight, seamless line all the way across the object where it's intersecting the water. You're not getting any of the waviness or the ripples or anything like that. Um, and on top of that, there's no way, um, currently with scenery to, uh, to have this water actually be 3d water, what, the way, the way it's doing this is with a bump map. Um, and I'm going to show you guys the difference between a bump map and a true displacement and a little bit.
Joey Korenman (00:02:40):
Um, so, uh, how can we, um, how can we actually get this ocean to have waves and rolling waves and ripples and things like that that will interact with the geometry? All right. Currently scenery, isn't set up for that, maybe in a later version. Um, I'll add that as, as a different type of preset, but what I'm going to show you guys is how you can use, uh, you can kind of make your own ocean, um, and you can still use scenery with it. You can still use, uh, these built-in 16 K skies that we provide. These are all seamless, by the way, you can rotate all the way around them. Um, and, uh, and you can use those to get great reflections out of your kinda, you know, home-brewed ocean. Um, so here's what we're going to do. I'm going to open a new Cinema 4D project, and I'm gonna add a floor to it.
Joey Korenman (00:03:28):
Okay. Um, because I want to show you something now in, uh, in scenery, all of the floors and scenery are actually floor objects because floor objects and cinema are infinite. So if I add a material to this and render it, you'll see, it actually extends way past where it looks like it's going in my, uh, in my viewport here. It looks like it ends here. When I hit render, it goes all the way to the horizon. All right. Which is great when you want a seamless floor. Um, one of the problems with that is that, uh, cinema will not let you put displacement on an infinite floor. Um, and let me show you what displacement is now. All right. So I'm gonna get rid of the floor and I'm gonna replace it with a plane. Let's make it a little bit bigger here. Um, and if you guys are following along, uh, what I'm doing is holding the five key and just clicking and dragging.
Joey Korenman (00:04:23):
Um, these are hot keys that everyone should know, uh, for let's you move an object, you click and hold for and drag five scales it, and six rotates it. All right. So this is the, kind of the hot keys for that. Um, so here we have a plane and, uh, so now if I render this, you'll see, you know, it, it renders exactly where we think it would. Um, so I'm going to make, I'm going to put this texture on here, and then I'm gonna change this texture a little bit, and I'm going to put a bump map on it and sort of simulate what scenery does. Um, so let's add a bump channel to the texture. All right. Come into the bump tab here, and let's add some noise to the bump. All right. If I hit render, you'll see, that's what we got right now that looks like absolute garbage.
Joey Korenman (00:05:10):
Um, the bump channel works in tandem with the specular channel, and it really doesn't work that well, unless there's a light in the scene. So let's put a light in the scene and just put it here. Okay. Now it's starting to work a little bit better. Now you can, what it's kind of telling you is the direction of the light source, and you can kind of see what it's doing. If I zoom out and look down at it, it starts to look a little bit better. It even kind of starts to look a little bit like water, right? And this is a similar way that scenery gets its water effect. Um, and you can get a lot of mileage out of this. Now here's the big problem with it is when you get really close to the surface of it, that illusion falls apart pretty quick.
Joey Korenman (00:05:55):
And it becomes very obvious that there is act, there's definitely no depth to this water. You're just faking it. All right. So what's the way around that. Well, there's another channel in Cinema 4D, uh, called displacement. All right. And if we turn off bump and turn on displacement, um, and then in the texture slot here, we can just add the noise. Um, and you'll see, let me close this window over here. You can see that in the preview now we've got this really spiky looking thing. Um, and that's because displacement actually changes the geometry of the object. All right. Um, so let's surrender this and see what happens right now. Nothing happens. Uh, and why is that? Well, there's, there's a few reasons. One is probably the displacement isn't turned up very high, so let's really crank the height of this. Okay. Now we're getting somewhere, um, let me turn that down to two 50 and do a render.
Joey Korenman (00:06:51):
Um, so what is this displacement channel actually doing? Uh, what it's doing is it's using whatever texture. I feed it here, which in this case is just noise and wherever things are dark, uh, it is going to sort of lower, um, that point of that geometry and wherever it's white, it's going to raise that point of the geometry. All right. And that's because I have the, the type of displacement set to intensity centered, centered means that things can, uh, you know, both, um, increase and decrease. Um, there's, there's another setting here that's just intensity, uh, where things that are black will not be affected and things that are white will be effected. All right. Um, now why does it look very jagged like this? Well, because by default, the displacement channel can only work on actual vertices. All right. And you can see that this plane doesn't have that many, uh, polygons here. You know, it's not subdivided very much. Um, and so when I render it, it looks pretty jagged. So there's two ways to fix that. Uh, one way is you could subdivide this more. I could add more segments to it. If I add a hundred and a hundred and render, you can see, I get a lot more detail now. Um, you don't have to do that though. Let me set this back to 20.
Joey Korenman (00:08:14):
Okay. Um, the other way to do it is to go into the displacement tab. And down here, there's a bunch of options for sub polygon displacement. Uh, and if you check this on, what it basically does is when you hit render it, subdivides your geometry and then displaces it. Um, so the advantage of doing it that way is you can work with this pretty low detailed geometry. And then when you hit render, cinema does all the, all this work behind the scenes to increase the detail of it. So your displacement map can work really well. Um, and so if I have that checked, uh, subdivision level four is actually high and set that to two. So if I hit render, now, you can see I'm getting a ton of detail there. All right. Um, so this is actually pretty cool. You could, um, you know, you can now come in to this texture here, this noise and click on it, and you get all the options for the noise shader in Cinema 4D, and there's a ton of options.
Joey Korenman (00:09:16):
Uh, the main one I'm gonna mess with right now is the global scale. Um, if we were trying to simulate water here, uh, obviously you don't want, you know, thousands of tiny little peaks like this. You want a few big ones, so I'm going to increase the scale of the noise, kind of stretch it out over a greater distance. So the global scale is 100 right now. If I make it 1000 and hit render, you can see, I now have this nice wavy kind of look to it. And what's interesting about this is it actually is changing the geometry. And if I, um, if I move this light over here, you can see the lighting is actually effected, um, you know, by the displacement. Um, and let me turn shadows on, um, because it's really cool. You can actually cast shadows with displaced geometry. Um, so this is a, this is one way to get, um, you know, T to get actual 3d geometry that now can interact with other geometry. If I put a cube in the middle of this and then hit render, and let me, uh, let me move the light over here so we can see it.
Joey Korenman (00:10:26):
You can see that the geometry is actually intersecting the cube. It's not flat at all. Um, so this actually works, and this is a possibility, but I quickly decided this wasn't the right way to do an ocean. And the reason for that was because if I want this cube, let's say to float and bounce and Bob up and down based on the motion, based on the motion of the ocean, I'm sorry. I could not help myself. Uh, you can't do that with the displacement map very easily. I'm sure there's some very smart people out there that could figure out how to do it. Um, I'm not one of them. So I wanted to figure out a better way. So let me delete this texture for a minute, delete the Cuban light. So what would be better is if there was actually a way to make this geometry displace, where we could see it and use it, um, and it turns out there is, so what I'm going to do first is scale this baby way up, right?
Joey Korenman (00:11:22):
Make it really big. Uh, and I'm going to add some more subdivision to it. So I'm going to make this instead of 20 by 20, I'll do 100 by 100. And what you're going to do is add a deformer to this. So click on your deformer tab and it's the displacer all right. And that should give you a hint, same thing as the displacement map, the difference is it's actually going to affect the geometry and we'll be able to see it and use that information. So in the displacer, um, you have a few tabs and the, uh, in the object tab, this is where you set the strength and the height in the shading tab. This is where you set a texture to act, um, as the displacement map to drive the amount of displacement. So I'm going to click on this arrow and add a noise shader.
Joey Korenman (00:12:12):
So we're just doing the exact same thing we did in the texture, but we're doing it inside of this, of the deformer. All right. So let's go on to noise. Uh, let's turn the global scale back up to a thousand, um, come over here and, uh, go to object and let's turn the height way up. And you can see that we're getting pretty much the same result we did before, except now you can actually see it. Um, all right. And, and this is going to allow you to attach things to the surface of the ocean, um, with a texture. I'm not really sure it's possible, but this way it is possible. All right. So the first thing I wanted to do is figure out how do I make, you know, how do I make big rolling waves for the ocean? Um, and you know, right now the noise, it's kind of giving me these big pillowy looking waves.
Joey Korenman (00:13:02):
These don't really look like ocean waves to me. Um, so what I wanted to do was, was kind of play with the noise. I'm gonna show you guys a few noise settings that are really great to play with. So we come down into the shading tab for the displacer, uh, click on noise, bring up our noise settings. Um, now the first thing we're going to check is, uh, the type of noise. So right now in this noise property here, it's set to noise. If you click on this, you'll see this actually quite a few. I mean, there's, there's two or three dozen different types of noise that you can use. Um, and they all have funny names and, and don't really tell you much what you can do that is useful as click on this tiny little hidden arrow over here, and you'll see a little preview of each noise.
Joey Korenman (00:13:47):
Um, and so you could try to find one that resembles water, um, and there's ones that are good for smoke ones that are good for kind of weird effects. He things. Um, the one I found that worked the best for water, um, and just kinda my opinion is this one way down here called wavy turbulence. If you look in this little, uh, this little bar, it'll tell you the name as you scroll over it. So let's click wavy turbulence, um, and you can see you kind of get like some big ways. We also get some little ones and it's kinda nice. Um, now it's getting very, um, you can tell it's, it's not very smooth right now. It's kinda [inaudible], uh, and that's just because, you know, we don't have a ton of geometry. Um, you know, I could subdivide this even more, but I don't want it to start moving really, really slowly.
Joey Korenman (00:14:37):
Um, so what I'm gonna do is just put this whole thing in a hyper nerves so that we can turn that off and kind of figure out what our waves are going to look like, and then just turn the hyper nerves on and get it much smoother. Okay. So there's a few problems. This noise is pretty obvious already. Um, so let's work on that. Let's turn the hyper nerves off, go into the display or click on noise. Um, all right. So the global scale is a thousand. Uh, I'm actually gonna increase that even more. Let's try 5,000. All right. And now you can see, uh, that we've kind of lost a lot of the detail. Um, and, and that's probably just because, um, you know, there might be giant waves just over here that haven't shown up through our plane yet. Um, so what I want to do is actually set up some animation to, to help me visualize what this looks like moving.
Joey Korenman (00:15:27):
Um, so with noise, there's two types of animation. Um, there is, uh, there's movement, which is basically taking the entire noise texture and moving it, um, which, you know, that, that, that's a good thing to do for an ocean because G in general, ocean water is sort of drifting in one direction or another. Um, so let's set that up. So let's say it's moving, um, it's moving, you know, uh, in the Z axis direction, you know, so from left to right. Um, and I think it's already set up that way by default, this movement here, this is actually telling Cinema 4D a direction. Um, so all you have to do is, uh, put one in one of these directions and that's the direction the noise will move. And then the speed, uh, tells it how fast it's moving. Now, what I've found is a little bit goes a long way.
Joey Korenman (00:16:20):
If I put this up to 5% and hit play, you can see how quickly it moves, it's way too fast. Uh, so let's try 1%. All right. That's not too bad. Let's just leave it like that for now. Um, okay. And so now, while it's doing this, I'm going to play with the global scale and just kind of try and find a setting that, that seems to work well. So 5,000, uh, looks funny, you know, it's, it's definitely not intense enough. Um, but then I might be able to just increase the height to all right. And what we're looking for here, we're looking for, um, you know, basically what, you know, if you were on the surface of this, does this feel like something the ocean does? Um, the answer's no, it doesn't feel like it. Um, so let's go into the noise and, uh, let's turn that global scale way up like 50,000, um, and try and get some really big waves, right. And then just kind of step back in increments of 10,000. And so we get something that sort of starts to feel like, like an overall wave emotion.
Joey Korenman (00:17:34):
I right. Maybe back to 10,000 now, uh, you know, what might help this is, if we go into the noise, I'm going to displace or go into noise and we can also animate the evolution of this noise and what that means is it's going to of change the noise over time. Uh, and that setting is this animation speed. Um, so just to show you guys what the difference is, if I turn this speed down to zero, so nothing's happening, but I turned this speed to one, right. You can see now it's kind of a, it's changing over time and it's actually kind of looking a little bit more ocean, like, all right. Um, so let's, let's make this comp a lot longer, I think, like 500 frames. And that way we can really see what's happening. So you, when you have this animation, plus this set this to one, can't seem to type, there we go.
Joey Korenman (00:18:31):
You start to get some really interesting motion. Now this is sort of feeling a little bit, uh, like cloth or something like that to me. Um, so I want to try some different noises. Uh, another one I found that worked okay, was this, I don't know how to pronounce it. It looks like stupid. All right. Now this one, uh, I think I need to turn the speed way down because it seems to, it seems to react a lot faster. Um, so I'm going to turn both the speeds down. All right. And this is kind of, uh, interesting, but it's a little bit too, you know, frenetic and random feeling. Um, so let's try some other ones. If we could just try, we could try blistered turbulence. Um, and this is actually starting to feel okay. Let's play with the speeds a little bit. Um, and let's play with the global scale. All right. So this is a 25,000. We're getting some pretty, pretty big waves. So let's turn that down to 5,000 and see what we get.
Joey Korenman (00:19:37):
All right. It's kind of interesting. Um, another thing to play with is this, this octave setting. So let me show you what that does. If I turn that up, I think the highest it goes is 20. It adds a lot more high-frequency noise, high frequency noise are these little chattering things, low frequency noise, or the bigger movements. If you turn this to one, it gets really simple. Okay. So let's turn it to two straight three, right? And now you're starting to get some just kind of gentle ocean waves. All right. And we could turn it back up to five. Five is where it was by default. And you can see we're starting to get, um, a lot of little, you know, high-frequency, and, and, and what I want to do is try and take that high frequency out and do that with a bump map, you know, let's get the basic movement down using the displacer and that way we can have things rock and, and, and float on this water, but then we can use texture to actually make it feel more like water now.
Joey Korenman (00:20:39):
Um, we're going to be, you know, I'm, I'm picturing my camera kind of right down on the surface of this thing. Okay. So this is moving way much right now. Um, it looks kind of cool actually, but, uh, I think it is maybe a little bit too high, so I'm going to turn the height down. Let's try 2000. Let's see what that looks like. Okay. So now if you're down on the surface of this and something's floating here, what one thing you gotta be careful of is because there is an edge to this. If you're going to use this as an ocean, you gotta make sure that edge can be hidden by the contours of this. Okay. Um, so I'm just going to play with noise little bit more. I'm going to turn the global skill down to 4,000, try and get a few more little waves and bumps out of it. All right. And that's, that's a good start, I think. Okay. All right. Um, so why don't we take this, this whole setup here and let's go back into our scenery scene and, uh, let me, let me just change this, this should say float.
Joey Korenman (00:21:45):
Can I make it a little, a little thinner? Okay. Let's move our camera out of here. Okay. So the first thing you need to do is turn off scenery's floor. Um, now scenery is an object preset, which means that it's built out of, you know, sort of Cinema 4D tools and the things that are already built into the program. It's just kind of rigged together with a lot of, uh, espresso and Python. And by default, I'm hiding all of that, just to make it simple to use. Um, you can turn that stuff on and the way you do it is you go into your layers tab and there's two sets of layers for site. There's the controls, which are visible. There's the layers, which are not, if you turn the layers on, uh, if you look under the em and you click that little icon, you'll see all of the scenery objects actually show up and you can see all the tags that are on them, things like that.
Joey Korenman (00:22:41):
Um, and this floor object, which I've called the Luminant, that is the one we want to turn off. So I'm just going to disable it. All right. Um, and now I'm going to paste the ocean from the other scene. Okay. Um, so now if we play this all right, we can kind of figure out where we need our camera to be. Right. And it's feeling like it's moving a little fast too. Uh, so, you know, looking at it in context always helps. I want to slow down the noise a little bit. So I'm gonna go back into the displacer or noise, and I'm just gonna slow down both the animation speed and the movement.
Joey Korenman (00:23:24):
All right. That's a little bit better. I could probably even be a little slower than that. All right. But for now that's good. We're getting some nice rolling waves. Um, you know, you could probably play with the noise a lot more and get it a lot closer to actual ocean, uh, for the purposes of this. We're good. All right. So now how do we texture this? Um, that is a very long answer. And I want to just point out right now that the goal of this is not to give you the perfect ocean texture it's because that takes a lot of tweaking. Uh, I've seen other tutorials where they kind of walk through it and people have spent weeks trying to perfect an ocean shader. Um, and, uh, you know, so it's really what I want you guys to understand is how to approach building an ocean shader, and then you can tweak it to your heart's content.
Joey Korenman (00:24:12):
Um, so let's start out, um, with just making a new material, let's call this water. Let's apply it to our plane. All right. Our hyper nerves right now is off by the way. Um, if you turn it on, it'll smooth things out, but we don't need it. It's actually looking fairly smooth with that. Okay. Um, so first thing I usually do in any material is I deal with the color channel. All right. So what color is water? Well, it's blue. Um, and it's actually not blue. It's actually, um, you know, it's, it's sort of depends. It can be clear or brown or even a little bit green. It just kind of depends on what it's reflecting. So a lot of the color from water actually comes from the, the reflection of whatever's around it. Luckily scenery has, uh, you know, a beautiful sky that it can reflect, so that'll help, but you should give it a base color.
Joey Korenman (00:25:10):
Um, so I'm just gonna pick, you know, this blue color here. Um, and when I rendered this, you saw another problem, and this is, this is a bigger problem that comes up when you do things like this is that, um, your sky, isn't going to extend far enough down, uh, to hide the scene. Um, and so what, uh, one of the good things about scenery is that I can kind of find, let me make this a little bit longer here. I can kind of find a frame where the water is the lowest, maybe, you know, maybe it's, it's probably here. Um, and I can see the horizon line. That's this dash line cinema showing me, um, that is where by default, the sky ends. Uh, I can go into the scenery object though. And, uh, there's a vertical shift parameter for the sky and I can just lower it.
Joey Korenman (00:26:03):
So now that sky will, uh, you know, will always meet the surface of the water and it kind of feels like we're down in the ocean, you know? Um, which is kinda cool. All right. And, uh, oh, I think I see a little bit poking out there, so I may have to lower a little bit more, or just lower the camera to kind of hide that. All right. Good. Um, all right. So let's turn on reflection on this texture and see, see if that helps. So, um, when you turn on reflection, uh, water's pretty reflective, so let's keep it at like 80 and just do a quick render a suit that looks like, okay. And you're getting, uh, you know, you're getting some nice reflections of the clouds anti-aliasing is on the lowest setting right now. Um, and so that's why it looks very jagged.
Joey Korenman (00:26:52):
Um, uh, but it's also incredibly smooth. It's, it's like Chrome right now. Um, there's another thing that happens, uh, with water and glass, which is, um, the Fenella effect, um, things reflect more, um, at a sharper angle to your eye than they do to like a more oblique angle. So you have to use a, a for Nell shader in the, uh, in the texture. I just realized, I explained that horribly. Um, let me see if I turn for nylon, it'll probably make more sense. Okay. So let's turn for now on, and let's set the mixed mode to multiply and what that's going to let me do by changing it from normal to multiply. It means I can still use this brightness here, you know, to make it less reflective, but the for now will sort of get combined with it. Okay. Um, so if I take this for now and I really crank it back like this, here's what you're seeing at these very extreme angles here.
Joey Korenman (00:27:58):
You're seeing reflections, but as the angle and by angle, what I'm referring to is what is the angle between my eye and this piece of the water, right? This piece of the water is at an angle towards me. I'm looking kind of perpendicular to it. So, um, that, you know, I don't want that to be as reflective as this stuff up here. Now I've really, you know, I've overdone it here to show you guys, but this is what for nail does. And if I drag this black, uh, this black box, you know, further back, you can see it can start to bring back those reflections closer and closer. Um, so, you know, I probably want it, something like this. Um, I just want to kind of get more reflections on, on these peaks then than on the parts that are facing me. All right. And it's, it's a little bit of a subtle effect.
Joey Korenman (00:28:48):
Um, but without it, uh, especially once you're seen as lit and gets a little busier, um, you will start to notice that it just doesn't look right. Okay. So that's the reflection channel, um, the specular channel. Uh, so watch now, the way I tend to think of specular is height is the sort of glossiness of it, right? As I turn the height up, you get a brighter hotspot and with is sort of the, the Domus of it. So if the width is really high, then light kind of spills across the whole thing. And if with this low, you just get this tiny little hotspot and that's closer to the way waterworks. Um, so it's a high height and a low whip. All right. So let's try that. All right. And, uh, there's not a lot of lights in this scene, so you're not going to get a lot of specular, but the, uh, the sunlight object that's in here is actually an infinite light.
Joey Korenman (00:29:43):
Um, so you should get some, especially once we add a bump map. All right. Um, so next let's add a bump map. Um, and we're going to kind of bounce around a lot here as we do this. So, uh, I added a bump channel. I'm going to add noise to that bump channel, and I'm going to go into the noise and I'm going to choose, uh, let's try this, uh, the stupid texture and let's just see what it does by default. Okay. So by default, it actually does kind of look swirly like water. It's very, very heavy, and I think the scale is wrong, but you can see that that bump, uh, did some really nice things to the reflections, to the speculars. It kind of broke it up and it doesn't really look like, you know, a blob of liquid metal anymore. It's starting to resemble something that might one day approach being called water. So, um, what I'm going to do is increase the global scale. Let's try a thousand. All right. So we can just get some bigger swirls, thousands too big is now I can't actually see it at all. Let's try 200.
Joey Korenman (00:30:50):
Okay. That's kind of nice. Um, I'm going to turn, uh, now when I, for the demonstration purposes of this tutorial, I don't want to get too far into animating the noise textures and things like that. Um, on the render that you saw at the beginning of this video, all of these noise textures that, uh, that I'm using are animated to try and make it feel more realistic. And those are the things you have to do to get a good water texture. Um, but that would take forever, uh, you know, to do a tutorial for us. So maybe next time, um, but just know that, uh, you would want to animate probably the movement and the evolution of this noise. All right. Now what, um, you know, what, what I'm noticing right now is that I'm seeing some good rippling here with this bump map. Um, but I also kind of want some, some fatter ripples, like this is kind of a sharp ripple.
Joey Korenman (00:31:45):
Um, and I might even, I might even bring that global scale back down to a hundred, cause I kinda like these sharp little edges that you get here, but I also want some bigger kind of ripples kind of buried in there. So I kind of need two noises, not just one. So how can you combine two negotiators? Um, this is where probably the most powerful shader in all of Cinema 4D comes in and that is the layer shader. All right. So the way the layer shader works, um, is if you already have something in your texture box here and you click on this arrow, go down here and click layer. So what it does now in the texture box, it says layer. And if I click on that, you'll see I've got this little a, it almost looks like the Photoshop layer browser. And that's exactly what it is.
Joey Korenman (00:32:30):
You can now add different images, different shaders, even effects like, um, you know, you can colorize and, and add, adjust brightness, things like that. Um, you can do all of this in this one shader. And the result of that is what gets used in your channel. So it's very, very powerful. So if I start with this noise, this kind of like fine sharp noise, but I want to add another noise. That's a little dollar and a little more Ripley. What I can do is click on shader, add a new noise shader. Um, and this one is the default noise. Let's see what that looks like. That one looks very Ripley, right? Um, and the ripples are way too big right now. So why don't we turn that down quite a ways. Um, and they're also very strong. You're getting a really dark edge here, um, which is, is probably too dark.
Joey Korenman (00:33:23):
Um, so what I'm going to do, and I want to name these so I can remember what they are. So this is my Ripley noise, and then this is my sharp noise. So I'm going to turn sharp noise off for a minute and Ripley noise. Uh, I'm going to just turn, I'm going to turn the opacity of it down. I'm trying to weigh down. Actually let's try five. Okay. So at 5% it just gives it a little bit of a rippling this to it, which is kind of nice. Then I can turn on sharp noise. I can actually put sharp noise on top of it. Um, and by default, this normal here, this is the transfer mode. So if sharp noise is on top of Ripley noise and it's set to normal, you're not going to see Ripley noise at all. However, just like in Photoshop, if I set this from normal to add, you know, or screen, then it will combine the lightest parts of both images and I can get the Ripley noise and the sharp noise.
Joey Korenman (00:34:24):
And now just to show you, if I turn Ripley noise back up, you can see, I can, now I can now change, uh, the noise and, and test my renders and I'm getting Ripley and I'm getting sharp and it's kinda starting to look a little bit more like water, um, this big blob over here. I'm not sure if that's specularity or reflection. Um, and that right now is the biggest problem that I'm having with this render. So let's figure that out. Um, what I'm going to do is turn off the specular channel for a minute and see if that's the problem. Okay. That was the problem. So there was a specular hit right there. That was way too intense for water. So let's go into the specular and let's turn the width down even further. Let's try 5%. All right. That is better. See, now you're getting kind of these highlights.
Joey Korenman (00:35:16):
This is a, this is closer to what water actually does it, doesn't get these big round fat specular heads. Okay. Um, cool. All right. So now, uh, let's talk about the color channel some more so water, you know, it it's, it's not always the exact same color all over the ocean. Um, so what we could do is we could use some noise to kind of make it a little splotch here. Um, but the main thing I'm noticing is that it's just so even there's no shadows to it, um, and there, and it, it just looks too flat even with lighting. It's not really given me what I want. So, um, what I'm going to do is go into the color channel for this material and for texture, I'm going to add a layer shader and just start with a blank layer shader. There's nothing in it.
Joey Korenman (00:36:06):
Okay. Um, so why don't we start with the base color? So the base color for the water is going to be this color here. Um, so I'm going to drag that into my quick storage panel down here, which I like to use. Uh, if you don't see this on your cinema, click this little arrow and make sure show quick storage is enabled, and then you can drag colors to it and they'll pop up, you know, everywhere. And you can, you can save your colors that way. So let's add a shader called color. And when you're in the layer shader, you click on the little icon next to the name of the shader, and it takes you to the options for that. Um, so let's open quick storage and click that blue. Okay. So we're starting with blue. So now we're basically back to where we started now on top of the blue, I want to add a, for Nell shader.
Joey Korenman (00:36:57):
I want to use the same trick we did with reflection, but I want to do it with color. And what I want is I want water that is facing me to be brighter than water. That is not facing me. And the reason for that is because if water is facing me, it means that it's kind of like a wave up in the air. And as I'm looking through it, that is a thin piece of water compared to the, the water that is, is not facing me. It's facing straight up and down because that water is looking straight down into the ocean, which is very deep. And so it's going to be darker because light can't pass through it the way it can a little piece that's up in the air. Um, if you look at, you know, this wave in the distance here, if you were looking at this, you would actually be looking straight through this wave to the back of it.
Joey Korenman (00:37:44):
You would see some light, not a lot, but a little bit of light would make its way to your eye. It would appear brighter. Then let's say, you know, the water in this little, this little valley right here. Um, because that water, uh, if you're looking at it, it's pointing down into the ocean where it's very dark. Um, so let's add a for Nell shader, right? And by default, it's just going to override your color. Um, and we can click on this and we can really crank these values to see what it's doing. Okay. All right. So right now you can see what it's doing is, um, everything that is facing me is getting this black color and everything that's not facing me is getting brightened. Right. And, uh, that let's, let's see if we back this off a little.
Joey Korenman (00:38:38):
All right. So this is kind of the effect we're going for. Actually, it's just the color isn't working at all. It's, uh, you know, you don't actually want, um, you don't want the sea to turn white. You want it to just be a little bit brighter. All right. So what I'm going to do is I'm going to change this white into, I'm going to click on this blue from my quick storage, and I'm just going to brighten that a little bit. Okay. And so now you're getting like some nice deep blues here, but you're getting some brighter ones up here. Um, and you know, it's kind of, it's kinda mimicking that effect of, I guess it would be kind of like subsurface, scattering, where light is passing through thinner parts of the object and changing the color. All right. Um, and what's cool. Is that now we could, um, we can dial that in a little bit.
Joey Korenman (00:39:25):
We can just play with the opacity of it. So it just, it just affects it a little bit. Okay. And if I turn that off and do a render and then turn it on, you'll see. It's a subtle thing, but it just helps with the contrast a little bit. Okay. Um, cool. So as far as the texture goes, this could use a lot of work. Um, you know, I'm going to show you one more trick and then I want to show you how to make the word float, actually float on the water. Um, but I encourage you to get in and play with the layer shader, because there's just so much you can do with it. Um, and you can really build these elaborate really cool, um, you know, textures that, that, that, you know, people will look at and they'll be like, how in the world is that even possible?
Joey Korenman (00:40:11):
And it's possible because you can stack these things and have hundreds of them all doing different things. So one big thing that's missing right here is, um, that white kind of foamy stuff that pops up when, you know, there's waves. Um, and I don't mean big white cap waves, cause that's not what these waves are. Um, I mean, just like the, the surface phoniness that happens on the ocean when it's moving. Um, so let's think about the best way to do that. Um, you know, it, it seems like foam and things like that. They're all kind of based off of noise. Um, so we're gonna use a noise shader, so let's just add one. All right. And let's just see what it looks like. Okay. So the noise shader on its own, uh, you know, it doesn't help us at all. It's just kind of muddies everything up, but you can see where there's light and dark areas, you know?
Joey Korenman (00:41:03):
Um, and so what I'm going to do is I'm going to first try to find a noise that resembles seafoam. Um, and I think, uh, I mean, just by looking, sometimes it's hard to tell this fire one could be promising, um, you know, and you can try different ones too. I think the one I like is this stupid one. And the reason is it kind of has these built in, I know it's kinda hard to see, uh, on the screen capture, but it's kind of got these built in wavy structures to it. Um, that really help it feel like liquid. Um, so what I want to do is I want to get rid of everything. That's not really, really white on this noise. So I'm gonna come down here in this section here, the low clip and high clip. This is kinda like controlling the contrast.
Joey Korenman (00:41:54):
There is a con a contrast control as well, but low clip lets you just control the blacks and you can see as I adjust it, make it higher and higher and higher. Oops. Um, you can see up here in the preview, it's getting rid of more and more and it's just leaving these little white areas. And even just by doing that, I'm starting to get some foamy stuff. Okay. Which is cool. Um, so the foam looks a little bit big to me, so I want to turn the global scale down a little bit, maybe to 50. There we go. And I want it to be a little bit brighter too. Um, so I can, uh, I can bring the high clip down and I'll get more white out of it. Okay. And you can see now you're kind of getting these little foamy elements on the surface of the water too.
Joey Korenman (00:42:46):
Now, right now they're evenly distributed everywhere. Um, so while if you look at one little piece of this, it looks great overall, it looks weird. Um, it, you know, water really shouldn't, shouldn't be like that. Um, so, oh, and on top of that, you can see that we've lost all of the nice color and detail underneath because this noise effect, uh, it needs to be screened over the color. So I'm gonna change this to screen. So now we're getting our for now and we're getting that all in one shader. All right. So again, the power of the layer shader. Um, so now I'm going to show you guys a really cool trick. I don't want this foam everywhere. I want little patches of it. Um, so now how the heck could we do that? That's actually, that's actually trickier. Um, so what I would do in Photoshop is I would, um, have the foam on a layer and that layer would have a mat.
Joey Korenman (00:43:43):
It would have another black and white image. That's controlling the transparency where it's showing through. You can actually do that in the layer shader. All right. So let's uh, let's grab another noise shader. Alright. And let's turn the contrast way up so I can actually just kind of visualize what we're going to be able to use for a mat. Cause what we're going to do here is create a mat. Now, if I use this as a mat, this might actually work fairly well. Um, but I'd like to try to, um, have bigger sections of foam and no foam. So let's turn the global scale up. Maybe like 300.
Joey Korenman (00:44:29):
All right. So something like this might actually work. Cause over here, you'd have a big area with no foam and here you'd have a big area with foam. Now I don't want these hard edges cause that's going to give it kinda kind of look weird too. So I'm going to turn the contrast down a little bit and now I'm going to get a nice soft result. So now how do we use this noise texture as a mat for our foam noise? All right, let's go back to the layer shader and let's name these layers so we can, uh, can identify them. So this is going to be our foam and then this one we just created is going to be our mat. So you can actually use a mat in this layer, shader and the way you do that. Um, it feels a little backwards to me, but the way it works is the matte layer actually goes underneath the layer.
Joey Korenman (00:45:20):
It's going to mat out. Okay. Um, so we set that from normal to layer masks, the very bottom option. And you can see up here in the preview that it's actually cut out the layer that's directly above it. So we're only getting noise in these few areas. All right. And if we do a quick test render, you can see there's noise here, uh, or foam here, there's foam here, but there's not really any foam over here. There's a little bit and it just kind of breaks it up. All right. And um, you know, if I turn this off and show you guys again, here is where that foam appears everywhere. And it, it kinda ends up looking almost like, um, I don't know, it looks like a bad fabric or something. Uh, and then when you turn this back on to layer mask and turn it on, uh, then now it breaks it up.
Joey Korenman (00:46:11):
All right. And it's just a little bit more natural. So this is where I'm going to leave the texture. This is not bad. And I think if you started, have you did a render with this, you would start to notice, uh, some of the sin. Um, but it's a good start. And now that you guys understand how you can build really complicated, uh, you know, layer based shaders like this, um, you could figure out how to do this exact thing in the bump channel, in the diffusion channel. Uh, you could even do it in the reflection channel, so you can do a lot of things, uh, to get your textures to feel good. Um, the next thing I want to show you guys is how we get this type to float on the surface of this. All right. So let's, um, I'm gonna just put a little protection tag on this camera so we don't move it.
Joey Korenman (00:46:56):
Cause I like where it is. All right. So first things first let's position this word in the ocean. All right. So let's, uh, let's take this object. Let's just move it down. So it's actually in the ocean and let's rotate it. So it's kinda lying on the back. All right, cool. So we like that now, obviously, if I hit play, this is what's going to happen and it's, that's not going to work very well. Um, so how can we get this onto the surface? Well, there is a pretty easy way that I figured out. Um, so the first thing I'm gonna do is hide this. I'm going to create a new Knoll and I'm going to call this flute. No. Okay. Um, now this snow right now is just floating in midair. I'm going to put a tag on it. So I'm going to control, click and add a character tag.
Joey Korenman (00:47:49):
And the character tag I want is constraint. Now the constraint tag, it basically attaches two objects together and it gives you a bunch of different ways to attach them together. Um, and you know, I'm not going to go over every single one. Um, but once you learn how to do this one way, you'll be able to figure out what the rest of these options do. So in this constraint tag, we're going to activate the clamp option. Okay. And clamp actually just means it's going to restrict one object's motion based on another object. Um, so when you add a constraint like a clamp constraint, you have to tell the tag, which object to clamp, the current object to. So the float and all has the tag, it's going to be clamped to whatever object I drag into this target box here. And you can have multiple targets.
Joey Korenman (00:48:43):
Okay? And sometimes you want that in this case, we just want one target and that target is going to be our plane. And now you can see why it's very important that we didn't use a displacement texture because we actually need to drag this geometry down into this target box. And it will use, uh, this displacement to calculate where the surface of this thing is. Um, so the next step is we have a target and, uh, we have to change a couple of settings on it. Okay. So the first setting is how do we want to clamp this float Knoll to this plane up here? Do we want to clamp it to the origin of the plane or something else? If you click on this box here, it gives you a bunch of options and we want to clamp it to the surface of that plane.
Joey Korenman (00:49:32):
Okay. So we'll click surface and you see, as soon as I did that, the null jumped and is now on the surface of the solution. And what's cool is if I switched to my move to when I moved this Knoll around, it's got a little bit hard to see here, but you can see it actually follows the contour and stays always on the surface. It's impossible for me to lift it off, but I can move it this way. I can move it this way and it will follow the surface. Okay. So perfect. And what's even better is as this thing moves, this thing will move up and down with it. All right. Now you're probably starting to see how this is going to work. So that's part one, uh, you know, just to show you what will happen now, if I, um, let me unhide my type object and I'm going to parent, I'm going to move the float Knoll right over it. Okay. And let's position this thing kind of where we want it.
Joey Korenman (00:50:31):
And then I'm going to parent the type under the float now. And if we hit play, it's floating. Okay. Pretty awesome. It doesn't look that realistic because all it's doing is floating up and down. It's not rotating at all. All right. Uh, and we really want it to kind of Bob up and down like a real, you know, like a boat would. So we have to do one more thing. All right. Um, this float Knoll right now, all it's doing is adjusting its position. It's not adjusting its orientation. So I want to turn that on. So I'm gonna go back into the constraint tag and the second set of options down here, where it says a line. So the first option is which access are we aligning to and I want to align to the Y axis, right? That's correct. Um, now how do I want to align, um, for something like this, you want to use, what's called the normal, uh, now think of the normal as the direction that a polygon is facing from a model.
Joey Korenman (00:51:36):
Okay. So, because this ocean is being distorted, um, you could see, you know, this polygon right here is pointed a little bit off to the right. It's at a little bit of an angle. It's mostly up and down, but not totally up and down. Um, and that angle is the normal. Okay. I'm not really sure why it's called the normal, but that's what it's called. Uh, so now if I look at the float now, when we play it, you can see that it actually is orienting appropriately. Okay. So let's turn this back on and take a look.
Joey Korenman (00:52:15):
I mean, that's, that's the basics of it right there. That's kinda how it works. Um, so now, just to, just to show you guys, one thing that can happen when you do this, um, what I'm gonna do, I'm gonna go into the displacer and I'm going to, uh, I'm going to turn the global scale down a little bit, and I'm going to turn the height up a little bit. Okay. All right. So now it's still working. Okay. But you can see that it's kind of doing some weird stuff and it's a little bit jerky in points, right? Uh, so what's happening is this Knoll is right here, but when you have a very turbulent surface points that are very close together, it might actually be very different Heights. You know? So like in this case here, when we get to this frame, let me scoot camera around here.
Joey Korenman (00:53:13):
So our Knoll is kind of here, but then on the right side of our object, the ocean is higher there. So how can we kind of compensate for a more turbulent ocean? Like this was actually a pretty cool way. Um, so the first thing I'm going to do is take my object out of this. No, turn it off. Um, so what, what I like to do is, um, get one Knoll set up and then just copy it and move the copy over a little bit, move the copy over a little bit, move the copy over a little bit. And you end up with a few different Knowles, right? That are all on the same surface. Okay. And what you can then do, um, is take this object. Um, and I'm going to hit option G option G group, whatever object is selected. It groups it under a Knoll, and it puts the Knoll in the exact same spot as the object. This is a very handy thing to do sometimes. Um, so now I'm going to call this float no main, uh, and what I want to do is put a constraint tag on this snow, have it look at these four Knowles and kind of average the position out in the rotation out. Um, so the way we're going to do that is, uh, we're going to add constraint tag. So character constraint, that's not a constraint tag. Let's try that again.
Joey Korenman (00:54:47):
Okay. Now this time, instead of the clamp, we, we could use this constraint. It's called the PSR constraint, and I'll just show you what it looks like. Um, PSR, it lets you clamp, or it lets you constrain one objects, position, scale rotation, or just some combination of those three to another object. And if you add multiple targets to this, it will average out the PSR of all those objects. So it's pretty cool. It's pretty handy in this case. If we do that, it's going to give us a pretty jerky feeling animation. Um, so, uh, so what we need to do is actually not use PSR. We're going to use a variation of PSR called spring. So spring, uh, it kind of works the same way. It, it, it takes the position scale rotation of one or more objects, averages them out and then applies that to whatever object has the tag on it.
Joey Korenman (00:55:47):
However, it does it in kind of a springy way. It's a little bit looser and you can control that looseness. Um, so with this float and all selected, I I'm in the constraint tag. Um, I am going to add a, there's already one target set up, right? So I'm going to add my first Knoll and you can see that what it did was it set the length here pretty high. It figures out how far away these two Knolls are, and it assumes I want to keep them that far apart, and that's not what I want. I actually want them as close together as possible. So I'm going to change this length to zero and going to check position and rotation. Uh, and then I'm going to add three more targets and I'm going to just one by one, add all of these Knowles to those targets, set their lengths to zero and activate position and rotation.
Joey Korenman (00:56:47):
Okay. Um, and if we have planned, now, it's going to kind of settle at first. All right. And once it settles, you'll see that now. And actually the surprise work a lot better. If I position this thing in the ocean, it's going to take the average of those four Knowles. And you can see the Knowles are here 1, 2, 3, 4. So you kind of want to position your type around that because that's, that's where it's kind of measuring how high the ocean is. Okay. And you can see that now it's actually kind of taken the average of those NOLs. And so this moves a little bit smoother, um, and it kind of, it kind of smooths out the motion of it, right? So here's where we've ended up. We've got our, uh, we've got our float object and we it's sort of constrained to a bunch of different Knowles and it's kind of getting the average of all of their positions and rotations, and it's using that information to smooth out and, and just kind of float on the surface.
Joey Korenman (00:57:49):
And, and right now it's kind of going, you know, up and down and it bounces a little bit, and it really is a pretty natural animation. Uh, now you're noticing every time the animation resets, um, this jumps right back into position, that's because it's set up as a spring. So what you actually needed to do is go to the first few frames and I'm using the F and G keys to go one frame forward and back, and just kind of go back and forth, because what happens is, as you go back and forth, cinema is running this spring simulation, right. And once you get, once it settles, go back to frame zero frame by frame, and then set key frames on this float Knoll main, I just hit F nine and set a position, scale rotation key for him. So now when I hit play, it starts in the right position.
Joey Korenman (00:58:44):
Okay. And you can see that it's, it's actually started a little bit high, so I'll have to adjust that. Um, but now when it goes back, when you started at frame zero, we'll start in the right position. These things are a little finicky, but, um, you know, a lot of times in, in this works, uh, sometimes with dynamics as well, you have to set a key frame on the first frame of your animation to make sure things begin in the right place. Um, so anyway, so, uh, so there you go, we've got a floating type. You've got a rippling ocean and you know how to begin the journey of coming up with a, a really good ocean shader. And, uh, when you put all those things together, you can get a really, really cool animation, um, in, uh, you know, you could even put the camera in this rig and have it feel like the camera's floating on the surface of the ocean.
Joey Korenman (00:59:41):
There's a lot of things you could do with this. And the, uh, the constraint tag is very, very powerful. There's other uses for it, but this is a great one. So there you go. Thank you guys so much. And I will talk to you soon. Thanks so much for watching. I hope you learned some new things in Cinema 4D today, from how to create custom shaders to a new way of rigging something that you may not have thought of before. And if you have any questions or thoughts, let us know. And we'd love to hear from you if you use any of these techniques on a project. So give us a shout on Twitter at school emotion and show us your work. And if you learn something valuable from this video, please share it around. It really helps us spread the word about school emotion, and we truly appreciate it. Don't forget to sign up for a free student account to access project files from the lesson that you just watched, plus a whole bunch of other cool stuff. Thanks again. And I'll see you next time.
Speaker 2 (01:00:40):