Maya DomeAFL_FOV_Stereo - zicher3d-org/domemaster-stereo-shader GitHub Wiki
Introduction
The "DomeAFL_FOV_Stereo
" lens shader renders stereoscopic fulldome content using the mental ray renderer. The node operates by creating an angular fisheye output that is drawn using a panoramic style of stereo rendering which is different than a traditional parallel camera technique because it takes care of the left and right stereo crossover zone that would occur at the back of the fulldome theater screen.
Let's explore the Maya user interface for the render node.
Adding a Fulldome Stereo Camera
A stereo fulldome camera rig is added to your Maya scene using either the Domemaster3D menu in the rendering menu set, or the "Fulldome Stereo Rig" tool in the Domemaster3D shelf.
Once a rig has been added to your scene, you can edit the fulldome settings by selecting the "DomeStereoCamera" in the outliner.
Next, you need to open the attribute editor window to the "center_domeAFL_FOV_Stereo
" tab. The "domeAFL_FOV_Stereo
" node controls are now visible.
Note: The attributes on the left and right camera's "domeAFL_FOV_Stereo
" nodes are driven using an expression from the "center_domeAFL_FOV_Stereo
" control.
Attribute Editor Controls
Let's go over the controls, one at a time.
Domemaster Stereo Shader Controls
The "Domemaster Stereo Shader" section has the primary controls for the fulldome lens shader.
Camera
The camera popup menu tells the node which view it's rendering. The options are "Center", "Left", and "Right". The "Center" control can be used to render a regular 2D fulldome image.
Since we added the fulldome stereo rig to the scene using the shelf preset the camera popup menu can be ignored because the lens shader camera controls are already tied into the correct left and right camera views in the stereo rig.
Field of View
The field of view control adjusts the focal length of the angular fisheye rendering. By default a fulldome image has a 180 degree field of view.
If you want to include a bit of the "ground" in the scene, it is possible to increase the field of view slightly to a value like 220 degrees and the final rendered image will still look acceptable in a dome.
Tip: If you want to render a full 360 degree angular fisheye image you will need to update the custom maps that are applied to the stereo separation, and turn attributes.
Dome Radius
The Dome Radius control can be thought of as a fulldome equivalent of the standard zero parallax zone in Maya's default stereo camera rig. This control adjusts the distance in the scene where the depth converges in the left and right eye views.
Objects placed closer to the camera than the dome radius distance appear to come out at the audience. Anything located in and around the dome radius distance appears in stereoscopic 3D as if it is sitting right on the wall of the fulldome theater screen. Objects placed further away from the camera than the dome radius value appear to the viewer as if they are existing beyond the physical wall of the planetarium screen.
Dome Forward Tilt
This control can be used to compensate for a tilted theater screen. If your theater has no tilt angle you can leave this value at zero.
Cameras Separation
This controls the stereo base of the stereo camera rig and is measured in scene units. Since a typical Maya scene is set to use centimeters the camera separation is set to 6.5 cm.
If you are working in a scene that has a large scale, or a scene with a small scale, you can freely change the dome radius, and camera separation values to match the world size and keep the stereoscopic effect comfortable on the eyes. However, when you are tuning the camera separation value and the dome radius values, you should keep a basic ratio between the two controls.
The default settings have a 55:1 ratio where the dome radius is set to 360 cm, and the camera separation is set to 6.5 cm. This would represent the scale of a 22 foot dome. If you wanted to have the same 55:1 ratio on a much smaller Maya scene you could set the dome radius to 3.6 and the camera separation to 0.065 units.
Some artists prefer to use a higher ratio value 110:1 with a dome radius of 720 cm with a camera separation of 6.5 cm. This would represent the scale of a 47 foot planetarium dome.
Fulldome artist Aaron Bradbury http://www.luniere.com/ has suggested a ratio of approximately 154:1 gives a near ideal fulldome stereo result (with a 0.372 degree maximum separation on the rendered image). This would equate to a dome radius of 1000, and a camera separation of 6.5 cm.
Dome Tilt Compensation
This checkbox enables or disables the Dome Forward Tilt control.
Vertical Mode
The vertical mode checkbox can be used if you have a curved fulldome screen that is mounted vertically against a wall and the viewers look forward at the screen.
Stereo Display Controls
These controls are used to adjust the orange hemispherical preview shape that is added to the fulldome camera rig. The preview shape will update in realtime to show changes to the dome radius (the zero parallax zone), and the "domeAFL_FOV_Stereo
" node's current field of view setting.
FOV Display Mode
The FOV display mode lets you choose the shading style used on the hemispherical preview surface that is attached to the stereo camera rig. The options are: Off, Wireframe, Shaded, and Wireframe on Shaded.
Zero Parallax Color
This color swatch controls the surface shader applied to the hemispherical preview shape.
Zero Parallax Transparency
The transparency slider allows you to make the hemispherical preview shape solid, or semi-transparent. The default value is 0.25 or 25% transparent.
A value of 0 makes the surface completely solid, and a value of 1.0 or 100% makes the surface invisible.
Double Sided Shading
Double sided shading make the inside and outside of the hemispherical preview shape visible. Setting the mode to show frontfaces or backfaces can make it easier to see through the hemispherical shape.
Safe Viewing Controls
These controls are still under development and will be used to display a dome optimized safe viewing volume shape that can be thought of as an "envelope zone" that the primary action in the scene should take place inside of.
The controls will adjust a preview shape that indicates the closest and furthest areas in the scene for comfortable stereoscopic depth viewing. The shape updates in realtime with the values from the current dome radius and camera separation attributes.
Custom Maps
This section allows you to link a screen space texture map to control the separation multiplier, turn multiplier, and the head tilt attributes.
These texture maps are applied with a fit-to-fill screen space mapping on the final image in the render view.
You can start with the default texture files that are stored in the C:\Program Files\Domemaster3D\sourceimages
folder or use the DomeTexture and DomeRamp tools in the Domemaster3D shelf to add your own custom maps.
If you use the DomeRamp tool on the separation multiplier attribute you can dynamically adjust the stereoscopic depth levels in your scene with a Maya ramp node and apply artistic decisions like flattening the depth at the back of the theater screen.
Image Orientation
The FlipX and FlipY controls allow you to mirror the image horizontally or vertically at render time.
FlipX Checkbox
This control will flip the rendered image horizontally.
FlipY Checkbox
This control will flip the rendered image vertically.
Extra Attributes
The "DomeAFL_FOV_Stereo
" node has a few extra attributes that are used internally. These settings are to be used by a technical director and don't need to be adjusted by an artist.
Dome Version
The Dome Version attribute tracks the version of the software that was used to create the original camera rig. The current value is 1. This control will allow future editions of the "DomeAFL_FOV_Stereo
" node to upgrade an existing camera rig and add new controls and preferences.
Preview Shape
This attribute tracks the name of the orange hemispherical preview shape that is attached to the current camera. This shape is created dynamically by the FOV Display Mode controls.
The preview shape "DomeStereoCameraPreviewHemisphere" and the preview curve 'DomeStereoCameraPreviewCurve" are parented to the domeStereoCamera rig so they follow the stereo rig in the scene when the camera is animated.
If you are curious, you can take a look in the outliner and expand the shape node + "plus sign" on the DomeStereoCamera rig. You will notice the preview curve and hemisphere geometry listed at the bottom of the stereo rig's group.
Preview Curve
This attribute tracks the name of the NURBS curve used to drive the creation of the orange hemispherical preview shape. The curve's shape adjusts in realtime based upon the "domeAFL_FOV_Stereo
" node's current dome radius and the field of view settings.
Note: The preview curve is hidden from the Maya scene with the "Intermediate Object" checkbox on the NurbsCuve.
Working in 3D
When you are working in the Maya viewport you can get a realtime stereoscopic 3D view of your scene if you look through the stereo camera rig. This view is rendered with a wide angle mode in openGL and is very helpful for working out comfortable camera separation, and dome radius settings in realtime with a pair of red/cyan anaglyph 3D glasses.
Let's look through the stereo camera rig. Open the Panels menu in the viewport. Select the Stereo > DomeStereoCamera menu item. This will put us inside the stereo fulldome camera.
Let's enable openGL anaglyph 3D rendering in the viewport. In the Stereo menu in the viewport, select either "Anaglyph" for a full color display mode, or "Luminance Anaglyph" for a black and white anaglyph version of the scene.
This screenshot shows a simple scene that has been rendered with the fulldome stereo camera on the left and openGL on the right (with luminance anaglyph mode enabled).
Since the viewport lacks raytracing support we can't see an exact match of the distortion in the fulldome image.
Even with this limitation in place the viewport is still extremely useful because it can save you making countless fulldome renders trying to fine tune the dome radius (zero parallax zone) and the camera separation values. If the hardware viewport version of the scene feels comfortable on the eyes, the raytraced fulldome version shouldn't cause eye strain either.
We can use the hemispherical preview shape in shaded mode to "cut through" the scene in the viewport and check what objects have negative vs positive parallax. What this means is objects "inside" the hemispherical shape will appear to come off the theater screen towards the audience, and objects outside the hemispherical shape will appear to exist beyond the walls of the fulldome theater.
Fixing Texture Artifacts
If you are experience a texturing artifact in your renderings that looks like a blurry streak that runs through a surface material it is caused by mental ray texture sampling issues on Maya native file texture nodes. A solution to this problem is to switch to using a native "mentalrayTexture
" node to apply textures to your surface materials.
For more details on the mental ray texturing artifact that effects 360 degree lens shaders check out the wiki topic Creating domeAFL Optimized Surface Materials.
There are three Domemaster3D shelf tools named color material
, color + bump material
, and color image sequence material
that make it easier to start creating mental ray shading networks that use a mentalrayTexture node.
Pre and Post Render MEL Scripts
When a panoramic stereo camera is added to a Domemaster3D based scene using either the shelf tools or the Domemaster3D menu, a Pre Render MEL and Post Render MEL script is added in the Maya Render Settings window automatically. This is used to control the stereoscopic rendering settings during render time and to allow Maya's realtime viewport's stereo display features to work so you can see an anaglyph preview in-scene.
If you have a scene with the Domemaster3D shader present and for some reason you need to manually add the Pre Render / Post Render MEL scripts, there is an "ADD" button on the right side of the Domemaster3D shelf that can do this for you. If you want to do this manually you can use the following values:
Pre Render MEL Script (Run when a new rendering is launched):
source "domeRender.mel"; domemaster3DPreRenderMEL();
Post Render MEL Script (Run when a rendering is completed):
source "domeRender.mel"; domemaster3DPostRenderMEL();
Prepping for Rendering on the Cloud
The Domemaster3D shader typically uses a Pre-render and Post-render MEL scripts to control the stereoscopic settings on the "domeAFL_FOV_Stereo
" and "LatLong_Stereo
" fulldome camera rigs at render time.
If the Domemaster3D shader is installed on a render farm that does not allow jobs to be submitted with Pre-render and Post-render MEL scripts in the Render Settings window, render farm customers should remove any Pre-render or Post-render MEL script commands in their Maya render settings.
If the render farm customer is rendering a 2D fulldome Maya scene everything is ready.
If the render farm customer is rendering a 3D fulldome or Latlong Stereo scene have them run the following MEL command on their personal workstation before sending you the maya scene file:
source "domeRender.mel"; domemaster3DPreRenderMEL();
This will make sure the camera's field of view is correct and the stereo rig is ready to render.
If there are lens shader artifacts that show up in Domemaster3D or LatLongStereo renderings, you can advise your customers to eliminate them by using the Domemaster3D shelf's native mental ray texturing tools when applying surface materials to objects in the scene. Also the applying Maya native camera shape FOV overrides (that are discussed on the Maya Domemaster3D Wiki's Tip's and Tricks page) can be used as another tool to help reduce/eliminate the lens shading artifacts.