|
|||||
|
|
#1 |
|
Registered User
|
procedural OCEAN shader for 3ds max
In this tutorial youl be making an anamatable procedural ocean shader like this:
First off set up your scene. Make a 20x20 plane thats 20 units by 20 units. Convert your plane to an editable mesh. In the surface properties rollout turn on subdivision displacement and set the presets to medium. Make a light and put it wherever you want the sun to be shining. Make the ambient light in your scene 96, 107, 128 for rgb. Give your scene a good background I'm using this one, you can find a good sample background at http://www.marlinstudios.com/ ![]() Make a render, you should have something that looks like this: ![]() Now for the material. Select a material and turn the specular level to 100 and the gloss to 70. Now add a waves material to the displacement chanel. In the coordinates rollout set the Source to "Explicit Map Chanel" and the water parameters as such. ![]() You can use object or world xyz for large scale projects but for better previews the "EMC" setting will do. Apply the material to your plane and render, you should end up with something like this: ![]() Now we need to add some secondary waves. we do this with the smoke material. but first we need to set up an output material and two mix materials. Make the submaps for the water material 2 different mix materials. make one of the submaterials in the first mix material you created an output material. Set the output material settings as such. ![]() make the submaterial of the output material a smoke material. Set the smoke material settings as such. ![]() Again for larger projects it's better to use the object or world xyz. In the second mix material you created instance the output material as on of the submaps. Now, for the Color #1 material of your water material (the first mix material) mix the output material with white with a Mix Amount of 95 (5% output material and 95% white) and for the Color #2 material mix it with black with a Mix Amount of 95 (5% output material and 95% black) Your displacement material should look like this: ![]() Make a render, You should end up with something like this: ![]() Next up is our water color. Water is a translucent substance and ocean water is somewhat cloudy, so not only does the water surface give off light but it's substance does as well. therefore thinner areas would be brighter then thicker areas. So for your diffuse color set up a new mix material. Set the first color to 0,45,48 rgb and the second color to 0,60,64 rgb. Make your Mix Amount material an instance of the output material you made for the displacement. The settings should look like this: ![]() Do a render, it should look like this: ![]() Almost there. No ocean shader would be complete without some good reflection but too much reflection will kill the look of your ocean. Make a falloff material in your reflection map. Now make a raytrace material in the second material box in the falloff parameters. Set the background to map and instance your background map. Back in the falloff parameters, set the falloff type to perpendicular/parallel and change the mix curve to how it looks in the picture. ![]() Your material should be bright arround the edges and a dark blue in the center with a little sharp highlight. Now make a render, you should have something like this: ![]() thats about it for an ocean shader. Take a look at the material heirarchy if you need to. ![]() If you want it animated all you have to do is change the phase of the water material and the smoke material. click the autokey button in the bottom right hand corner of the screen and then drag the key slider to frame 100. Then go into your water displacement map and change the phase to .5. Go into the smoke map and change the phase to 1. These settings seem to work per hundren frames. right click on the phase value and click show in track view. Youl notice a curve in the line. Select both keyframes and right click and chose properties. click the curve types and chose the first one for both in and out curves. Do this for the weter material as well. animated water If you want to make a really big ocean scene youl need a bigger plane. It's a good idea to create a multiresolution plane so not to take forever to render. To do this make a plane as large as you like and with the LOWEST mesh resolution you want to use. Go into polygon sub object mode and select the half that is closest to your camera. Add a mesh smooth modifier with "Iterations" set to 1 and "apply to whole mesh" unchecked. Do this again getting closer to the camera as many times as you need. You can also go back in an delete polygons you wont see to decrese render time. My scene looks like this: ![]() A good way to make your ocean seem really big is to put the water material in a gradiant. Use the water material in the first 2 maps and a mix material of your water material and black for the third so your displacement map gets darker the further away the water goes. (dont just use black or you'l get a bright line across the horizon because of your reflection) This shortens the waves further back and leaves you with an almost perfectly flat horizon. and here is what I rendered: ![]() I rendered all the different maps seperately and composited them in photoshop to get the best look. the lens flare was also done in photoshop. I hope this tutorial helps you along in you ocean making endevours.
__________________
3d artist for adoption, e-mail for a portfolio. Last edited by Michael Voeller; 09-03-2007 at 07:27 AM.. |
|
|
|
|
|
#2 |
|
Threedy Member
Join Date: Feb 2003
Location: Germany
Posts: 2,361
Thanks: 0
Thanked 1 Time in 1 Post
|
Hi Michael,
I assume you have posted this tutorial in response to our Total Textures CD-Offer, as described in the sticky in this forum, is that correct? ![]() Let me thank you for writing this tutorial and posting it here! Your tutorial qualifies for one free CD of your choice, but before you can recieve it, we have two tiny requests, if you please. Is it possible for you to describe the process of animating the shader (the last sentence) in larger detail, say 5-10 sentences? And could you render a larger final image of the water, perhaps with a horizon and a sun? It'd be great if you can do so. Many thanks, Michael. Everyone, let Michael's step forward encourage you to write something yourself, we are all ears (and eyes of course ) for your ideas!
__________________
[b]Christian |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Feb 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hella nice :)
wow, this was hella nice !
btw, do you know any way of making this animation looping seamlessly? thx ! |
|
|
|
|
|
#4 |
|
is studying.
Join Date: Jul 2003
Location: Pakistan
Posts: 829
Thanks: 0
Thanked 0 Times in 0 Posts
|
well!
congrats man.......i got late in postinmg my tut on this.....i am doing a big tut, about shaders....in which, i wud include ocean shaders too!
anyway, congrats!
__________________
But in the end, no matter what i pretend, the journey is more important than the end or the start, and what it meant to me will eventually be a memory of the time WHEN I TRIED SO HARD! Mental Ray Rendering And shader Discussion thread |
|
|
|
|
|
#5 |
|
Legend Edgemaster
Join Date: Oct 2002
Location: The Netherlands
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi Michael,
Thanks for the great tut. I was looking for a good water tutorial and this one is very good! But I stumbled upon problem while doing it. Everything went right upto the creating the secondary waves. The final displacement map looks exactly like the one in your tut, but somehow when I render it only the large waves show. When I use the instanced output material on the falloff map, the details kinda shows, but the little waves still don't render. Any thoughs on what I might be doing wrong? Ive attached the final image for you to see.
__________________
"Although all of this remains quite questionable" Last edited by Supervlieg; 30-12-2003 at 09:29 PM.. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Dec 2003
Location: 6 feet under
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
|
My displacement map doesn't work. After i apply it to plane nothing is changed in render. Plane is flat. Why???
|
|
|
|
|
|
#7 |
|
Registered User
|
Supervlieg: from here it looks like you need to increase your subdivision detail. In the surface properties of your ocean mesh up the detail to medium or high as the secondary waves are geometry as well.
Drizzt: You probably need to turn on subdivision in the surface properties of your ocean mesh. again turn it to medium or high.
__________________
3d artist for adoption, e-mail for a portfolio. |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Dec 2003
Location: 6 feet under
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
|
THX i'll try.
|
|
|
|
|
|
#9 |
|
Legend Edgemaster
Join Date: Oct 2002
Location: The Netherlands
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks Michael, That did the trick. I read over that part in the tutorial. My bad.
__________________
"Although all of this remains quite questionable" |
|
|
|
|
|
#10 | |
|
Registered User
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Quote:
I'm pretty sure that the Mental Ray Ocean Shader has a loop setting.. But I'll have to double check on that.. |
|
|
|
|
|
|
#11 |
|
Professional n00b
Join Date: Apr 2006
Location: UK
Posts: 630
Thanks: 0
Thanked 0 Times in 0 Posts
|
Man this tutorial is awsome! Excelent work! Works like a dream. Now I know how they make realistic oceans in all those movies with CGI water!
Is there are way to animate the water so that it is affected by a passing ship or something? E.g. Is it possible, to edit the smoke material in photoshop, to change the water's aniumation, like a ship passing through it?
__________________
http://gordon131.deviantart.com/ My RTS blog Retro Coders Completed Game! :Retro One Last edited by gordon13; 04-02-2007 at 02:28 AM.. |
|
|
|
|
|
#12 |
|
Registered User
Join Date: Jul 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
I am stuck on the first part the displacement part..
I am using max 9 and it has no water material that i can choose for the displacement map, Is wave the same?. |
|
|
|
|
|
#13 |
|
Registered User
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hey great tutorial but its a bit unclear. I followed it as best I could and got this:
![]() What did I do wrong? Here is my material list: ![]() BTW im using max 9 if it helps. Last edited by Pectabyte; 31-03-2007 at 02:03 AM.. |
|
|
|
|
|
#14 |
|
Registered User
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Michael,
im getting good results thanks to you TUT. There is one question. when i place an object in the water it tents to be lower when i render. I put a sphere in half way, but on the render only 1/4 is stikking out. oeps just found an other question. Is there an easy tweak to get the same results with mental ray. |
|
|
|
|
|
#15 |
|
Registered User
Join Date: Apr 2007
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
I was trying to get that horizon to work with the gradiant, but i couldn't figure out where to do the gradiant and what not. So I guess that part is unclear for me right now. If anyone knows please let me know.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
| Thread Tools | |
| Display Modes | |
|
|