November 28, 2017 Workshop 17 Notes

UNDERWATER CAUSTICS, FLUID DYNAMIC EFFECTS AND V-Ray

     fish swimming underwater

     Still image from Katie Banach's final project - Treasure Hunt (Katie Banach)

 

Part 1. Creating an Underwater Caustics Scene (notes based upon Katie Banach's final project)

1.  Import an underwater scene from the Maya Visor. Open the visor by going to Windows > General Editors > Content Browser.

      Open the Ocean Examples. Right click on the UnderwaterCaustics example and Import the Maya File.

      choose content

        
       

2.    Create an ocean floor.

      Create a nurbs surface plane. Give it 15 x 15 subdivisions.

      Add some vertical deformations to the plane and then move it up slightly above the ground plane.

      Create a polygon sphere. Use the scale tool to create an oval, fish-like shape.

3.  Open Windows > Rendering Editors > Hypershade

      Within the Hypershade Window, give the "fish" a modified "V-Ray skin" material

      For the ground plane material, ensure that the viewer in the Hypershade panel is "V-Ray" and not "Hardware".

      For the ground plane create a sand color with a "V-Ray Mtl" colored light beige and a fractal bump map.

     modified

4. Edit the ocean settings.

      Open the Windows > Outliner. Open the Attributes Editor for directionalLight1.

      Under the Shadows tab, turn off the Depth Map Shadow and turn on the Ray Trace Shadows instead.

      Go to the ocean1 tab. Change the Scale to 50.

      Right-click on Time > Edit Expression. Change the time expression to ocean1.time = 0.25 * time;

      Change the Num Frequencies to 3.

      ocean attributes

5. Back to the Hypershade pannel, edit the physical fog and water settings.

     Open Windows > Rendering Editors > Hypershade

     Go to The Materials Tab

     Click on the envFogMaterial to open it's attributes. Play around with these values until you get the desired look.

     Under Physical Fog > Water

          Change Water Level and Water Depth to 60

          Change Water Density to 0.080

          Change Water Light Decay to 0.200

         This is also where you can change the water color and opacity.

     Under Clipping Planes

            Change Fog Near Distance to 12

            Change Fog Far Distance to 200

     edit fog material

6. Change the Render Settings

     Select the render using "V-Ray" option. (use Maya software for quicker testing of general lighting conditions).

     Under the Common tab.

            Set  file name prefix to "underwater"

            Set image format to "jpg"

     Under the Animation Tab

            Set Animation to Standard        

            Setup Start frame to 0 and End frame to 200.

            Set image size to HD 540.

           Select the rendering camera to UnderwaterCam

           common tab

     Under the GI tab.

           Under Caustics Tab> Caustics, turn on Caustics.

       turn on caustics

7.  Turn down the intensity of the direct light to 0.5 and the ambient light to 0.2,

 

        rendering

 

8. Batch render to see the caustic effects

 

Part II. Fluid Dyamics with Maya Software (only)

Start a new scene file to create a boat moving on water with Maya Software. In this part II we will be using techniques involving an "Ocean Shader" that is not renderable with V-Ray. In Part III we will look at an alternative technique that is renderable in V-Ray.

Our objective is to reproduce a simple version of the following movie (select image below to see 11 MB QT file) in Maya Software

       boat on water           
          Select image to see movie (note large 8 MB file size) 

 

1.   Within the new scene file and set the number of frames to 200. Enter the FX module, and create an ocean by selecting the menu item check-box for Fluids > Ocean.

          ocean menu

     Select the oceanShader tab automatically created for the ocean and modify the following attributes:

          Graphically change wave peaking by adding points and manipulating the wave profile.

          Change foam emission to add more foam, such as setting it to 0.5

           Change foam threshold to increase the relative appearance of foam, setting it to 0.525

           Under specular shading, increase specularity to 0.75

           Under  specular shading, set eccentricity to 0.305.

           Change reflectivity to 0.7

     

      ocean shader

2.   Go to the view menu, camera attribute editor, and select the environment tab.

     camera attr editor

3. Select the "Create" button above, and within the dialog box the follows, choose type "texture".

    choose type texture


4.
Select the checkered box adjacent to the word "Texture" and then choose a Maya "Env Sky"

    choose env sky

5. With the selection of the "Env Sky", turn off the option to "Use Floor Attributes", and then set the "Elevation" to 70 and the "Azimuth" to 155. Other properties to explore include "Sun Brightness", "Clould Brightness" and "Density.

   env sky attributes

6. Create an ellisoid from a nurb surface sphere and place it on the surface of the ocean.

  ellipsoid

7. Select the ellipsoid, go to Fluids Menu add use the menu sequence "Create Boat/Make Motor Boat" below to create a motor boat.

  make motor boat

8. The ocean and motor boat objects are now completed; however, to get the motor boat to move, select the locator object in the window outliner.

  outliner

9. Next in the attributes editor for the locator, select the "locatorShape1" tab, expand the "Extra Attributes" tab, and change the "Throttle" (engine power) to 4 and the "Rudder" to 20.

  locator attributes

10.   Play the animation and let the simulation handle the movement of the boat. Note that "Env Sky" creates the background sky, but lighting is defaulted and is not actually set into place by the specific position of the "Elevation" to 70 and the "Azimuth" to 155.

 boat render

11.   To complete the scene, add a type "directional" light from the "render" tab, which is the second one from the left-hand side.

    maya software lights

18.   With the "directional" light selected, go to the menu sequence "Windows/Modifier/ShowManipulatorTool" and adjust both the position of the light and its target to the orientation desired. Note that a direction light provides a kind of distant light source that is approaximated at any one location by sending parallel light rays to the ground such as would be the case with sunlight.

   manipulate sun

12. Adding some additional objects and Maya Software shaders, we get a dynamic environment similar to the original animation above.

boat render

13.  One more option to try: Create a wake for the boat.  

       Select the boat and select Fluid Effects > Create Wake. 

       Select the OceanWakeEmitter1 associated with the boat. Open the Fluid Emission Turbulance Tab. Set the value of Turbulance to 10.0.

     

 

Part III.   Fluid Textures With VRay.

        As already noted the texure and fluid dynamics techniques illustrated in part II are not renderable inVRay. However an alternative method is possible.

        1. Go to the V-Ray tab, right-mouse click on the "Sun" symbol on the right-hand side of the light types, and add a sunlight to the model space.

       

            light types

        Once the sun is placed in the Maya model., Set the V-Ray sun position's geographical locations as:

        Latitude = 38       -Mid Atlantic US
        Longitude = -78

        Time Zone GMT - 5:00 - US East Coast TIme

         Local Hour 15 (3 pm)

         Date: 11.27.2017

        sun position settings

       2. Under the VRaySunShape1 tab, set the sky model to Preetham et. al.

      3. Under Ray Trace Shadow Attributes, turn on "Shadows" and "Cast Shadows From Environment.

      shape attributes

11.    Optionally, add a point source light to the model from the light palette, 3rd icon from the left

        light types

12. Now add a polygon surface plane to the X-Z ground plane and subdivide it into 12 x 12 subdivision units in its "width" and "height" through the channels dialog box as done in prior workshops.

       subdivide polygon

13. In the "planeShape1" tab for the polygon surface, right click on the "Attributes/VRay" menu at the top of the dialog box and add "displacement control".

      

14. Within the hypershade panel create a VRay material that is a new, slightly dark gray, and also has a a dark gray refraction value for a small degree of tansparency and refraction.

      new material

15. Continuing withing the hypershade window , open the bump map tab for the new material, and select the checkered box to the right pf the word "map"

     bump map tab

16. Now, in the dialog that follows, select under VRay 2D textures option a VRay water material.

vray water

17. Applying the water properties as a bump map and adjusting its paramters, the original VRay material is modified as in the following sample.

   water applied

18. Due to sun color temperature the initial rendering of the the ground surface is a bit yellow. However, adding a VRay sky and other environmental features will alleviate this. Moreover, the water material is an animated map that will cause the effects of water movement in the surface when the scene is animated..

    vray water

 

19. Continuing within the Hypershade Window, the output of the material VRay water is connected to an a input "Displacement" port of the component "VRayMtl3SG" of the original "VRay Mtl" shader, and the displacement for the "height Multipler" of water and rendering of the water level changes height accordingly.

  hyperShadeMaterial Diagram

  vray water rendering 2

 

20. To add a sky, repeat steps 2, 3, and 4, of Part II above. However, here we will use a VRay sky alternative to the Maya sky.

  VRay Env Sky

21. In the dialog box that follows, we see the VraySky in the attributes editor. Do NOT check the box that says "Overwrite Sun Settings", and the sky will inherit the values of the Sun light created in step 1 above.

  

  sky attribute editro

22. Next, render the scene in the V-Ray Render Buffer. Here the sky appears too bright and the water surface is still brownish reflecting the color temperature of the sun.

  render with VRay Sky

23. However, expand the VRay Frame Buffer Window by selecting the icon in its lower left-hand corner. In the expanded dialogue box on the right-side, select on the option for "White Balance" and move the slider to the left (or right) until the color of the columns, which should be white, turns white. This is the equivalent of correcting for color using a "White Balance" on a real camera which is a way to adjust to color temperature of the exposure. For more details on working with the V-Ray Frame Buffer see this link on V-Ray Color Corrections. Rendering again will result in a corrected color balance.

 white balance

24. Returning the shader for the water, increase the density of the texture map to "Repeat U V" 8 x 8 times.

   increase density

   Also, change the diffuse color to a darker shade of gray and increase towards white a lighter gray refraction color for greater movement of light through the surface of the water.

   adjust shader colors

  Re-render and see the result. Select the following image to see a brief animated video clip.

boat on water