Sharp edges and smooth shading normals in Massive

The Problem

A user wants to import an object with both sharp edges and smooth edges into Massive for rendering with Air.   This should be easy except that Massive only allows one shading normal per vertex, and Massive automatically smooths any vertex that is shared by more than one face.

The Solution (reported by Air and Massive user Charlie Peterson)

In Maya separate the faces into two objects, to be exported as two separate OBJ files.   All faces that should appear flat with sharp edges go in one file; all faces that should appear smooth go in another.  For faces with sharp edges, each vertex must be unique; i.e., not shared with any other face in the model.  In Maya this can be accomplished by using the Detach Component action in the Edit Mesh menu.  The two sets of faces can then be exported as OBJ files without shading normals or smoothing groups.

Posted in Massive | Comments Off on Sharp edges and smooth shading normals in Massive

Adding a background plate to a Massive crowd rendering

A user recently asked how to render a preview image with Air from Massive that included a background plate.   The Massive camera node includes an option to specify a background image, but that setting is not exported to rib for rendering with Air.  Hopefully Massive Software will add this feature in a future release; until then, here are a couple alternatives:

Option 1:  Use a small options file with an imager shader to add a background image:

  • Create a small text file with the following imager declaration:
Imager "VBackdrop" "string TextureName" "nameofbgimage.jpg"
  • Enter the options rib file name as the “options rib include” entry in the ‘render parameters’ tab of the renders dialog.
  • Drawback:  the imager shader will be included in the rib export for preview rendering and normal rendering.  If you do not wish to include the background image in final rendering, you’ll need to remove the options reference prior to exporting ribs for the final render.

Option 2:  Use Air Show to view the rendered preview image with a background plate

  • Air Show has an option to display a rendered image over a background plate, but that option is only available for images with an alpha channel.  Unfortunately, the Massive preview image is always “rgb” only, so again this is not as easy as one might hope.
  • A solution is to render the preview rib from a command shell and use Air’s command line options to override the output declaration to include an alpha channel.
  • When rendering a preview image with Air, Massive exports the rib files and other data to $TEMP/massive.  To render the preview rib from a command shell:
cd $TEMP
cd massive
air -d -mode rgba massive.rib
  • You can leave the command shell open and re-launch the last command for each preview.  Note that this means each preview will be rendered twice.  If the preview render takes more than a few seconds, you can use the red stop button in Air Show to abort the first preview render.
  • To load the background image in Air Show, select Load Background from the View menu.  Use the checkered toolbar button to enable or disabled display of the background for the current image.
Posted in Massive | Tagged , | Comments Off on Adding a background plate to a Massive crowd rendering

Animated Ocean Waves

Air 11.08 and later includes a new set of shaders for rendering animated ocean waves based on Jerry Tessendorf’s paper “Simulating Ocean Water”.  The shaders are:

OceanWaves – displacement shader for the waves
OceanSurface – surface shader for deep ocean
OceanSurfaceWithForm – surface shader for deep ocean with foam at wave peaks

The following images use the ocean surface shaders along with the physical sky environment shader.

The underlying wave algorithm can simulate a variety of ocean conditions from calm seas to stormy waves depending on the wind speed:

ocean wind speed 5

The appearance of waves in windy conditions can be improved by adding chop, which sharpens wave peaks and stretches troughs by shifting the surface laterally:

Because the chop displacement shifts the surface in arbitrary directions, you’ll need to tell Air that the displacement is not strictly in the direction of the surface normal by applying the following attribute:

Attribute "render" "normaldisplacement" [0]

Note that too much chop can tear the surface apart.

Finally, the OceanSurfaceWithFoam surface shader allows foam to be rendered near wave peaks.  In order for the foam to appear in the proper location, the common parameters between the OceanWaves and OceanSurfaceWithFoam shaders must be set to the same values.

ocean with foam

If you do not need to render foam, set the FoamEnabled parameter of the OceanWaves shader to 0 to reduce computation time for the waves.

Wave animation is controlled by the current frame number and the FramesPerSecond parameter value.

The waves can be tiled in X and Y; the above pictures are a 2×2 grid of the same wave pattern.

Posted in Shaders | Tagged , | Comments Off on Animated Ocean Waves