Rendering large scale ocean surfaces in Maya

aaocean_maya

Rendering large scale ocean surfaces can be an hard task to accomplish, there are plenty of plugins and built in tools to do it, but it’s not always simple to setup and understand the technical attributes. In this post I will walk you through the scene setup to achieve the final result you can see in the above image.

aaOcean

In this scene I am using the aaOcean arnold shader/deformer, which is an ocean simulation plugin based on Tessendorf waves, similar to the HotOcean and other free plugins for Maya.

aaocean deformer shader

So, this comes as a shader and a deformer, the shader will output a vector displacement map that you can use to displace the surface at render time, and the deformer will obviously deform the shape in the viewport. I found that the deformer will work great as a preview to set the right scale and the animation pattern, but then you will need a lot of polygons to get more detail, and that’s when render time vector displacement is better, using the shader and render time subdivisions.

Scene setup

The scale of your scene will affect the settings of the aaOcean node, in this particular scene I am using real world scale, with the ocean surface beeing around 500 meters. You don’t have to use this scale, but then make sure you multiply down the aaOcean settings according to your scene size.

maya viewport

So we will use a polygon plane for the ocean surface, in this scene I scale it up to “56504 cm” to cover the camera angle, and give it 300 subdivisions(width and height) as a starting point.

Select the plane and in the script editor or the command line run the command “deformer -type aaOceanDeformer; “. This will attach an aaOcean deformer to your plane, and now you can start to play around with the attributes to get the result you looking for. For my particular setup I am using the following attributes:

aaocean deformer maya

In the “Current time” attribute I have an expression “aaOceanDeformer1.time=frame/14″, that will give me the correct/desired flow to the ocean animation.

So now it’s a good time to do a playblast of the scene to check if we are happy with the scale an pattern of the waves, adjust the attributes if you want a more “stormy” look, in this scene I want a simple flow of the waves.

maya playblast

Vector displacement setup

Now that we have a rough idea of the attribute settings that we need for our scene, we can translate it to the shader. You can duplicate the scene and remove the deformer, or create a new polygon plane with the same scale. Make sure you reduce the subdivisions, in this case I am using only 50, then I will subdivide more at render time.

maya shading_network aaocean

Create a aiStandard shader and apply it to the polygon plane. Now we need to setup the vector displacement, create a displacementShader and an aaOceanArnold node. Connect the outColor of the aaOcean to the VectorDisplacement attribute of the displacementShader.

Now we need to replicate the look of the deformer in the aaOcean shader, I ended up tweeking a few of the attributes to achieve the desired look. Notice that I increased the resolution attribute so I would get more details, keep in mind that this will slow down the “pre render” calculations, there will be a delay before it starts to render (at least in my machine). The remaining settings are basically the same of the deformer, in the time attribute I am using a different expression “aaOceanArnold1.time=frame/140″.

aaocean shader

Shading setup

So, before rendering we will change the aiStandard attributes, leaving the diffuse to black and adding specular and refraction components.

aistandard shader maya

You could go with a more advanced shader setup, playing with the transmittance color and scale to get a more physical correct material, but in this case I used a flat diffuse blue color shader in a simple plane below the main ocean surface.

diffuse plane maya
cg generalist course therenderblog

Rendering

Before we start to so some test renders, we need to increase the subdivisions of the ocean surface so we can take advantage of the high resolution ocean grid set in the aaOcean shader. In this case I use 4 catlark subdivisions in the shape attribute of the polygonPlane.

no bump

So we do our first render, but the result isn’t that great. Looks like we need to increase the subdivisions of the geometry, but that would kill our render times or even crash Maya.

autobump maya arnold

Since we already have a good amount of polygons, what we can do is try to get some extra details with a bump map, and a quick way to achieve that is by enabling “auto bump” in the displacementShader. And if we compare with the previous result we get a much better result.

auto bump

That’s it guys, if you have any questions/suggestions use the comments section below. And if you like our articles you will probably enjoy our course, the CG Generalist Course.

Thanks for reading.

  • damaggio

    Ola Joao, Ive downloaded the AAocean from Amaan but it comes with no installation Read me….the .dll and .mll files not sure where they go, I’m using Maya 2015 rendering in Mental….is there a way you could post the path for those scripts…cannot find any help on the net…obrigadao .

    • therenderblog

      this image should help you out, but I am using arnold here. Abraço

      • therenderblog

        Usually the mll and dll’s you shoukld place them in the plugins folder of your maya installation:

        C:Program FilesAutodeskMaya2014binplug-ins

        Here I have the aaOceanDeformer.mll

        • damaggio

          Obrigado pelas dicas Joao, I’m gonna try in the morning.
          Cheers.

  • Scott Bell

    I’m trying to migrate over from hotOcean, since aaOcean has a lot of useful additions, but I’m unable to get the deformer and shader to match between the maya deformer and the mental ray shader. There are quite a few missing parameters on both nodes, so I can’t get the same output between them. Has anyone got this to work?