Maya Getting Started Guide - zicher3d-org/domemaster-stereo-shader GitHub Wiki
Note: This Wiki page is a legacy article. The suggested way to set up a new scene with the Domemaster3D shaders is to use the Domemaster3D shelf tools, or the Domemaster3D menu items that are accessible in the rendering menu set. This page is being retained in the Wiki as it provides a bit of insight into the connection methods that are used by the Domemaster3D internal MEL script functions.
Table of Contents
- Step 1. Creating the Base Domemaster3D Shading Network
- Step 2. Creating a Stereo Camera Rig in Maya
- Step 3. Adding the domeAFL_FOV_Stereo Node
- Step 4. Rendering a Domemaster Stereo Anaglyph Preview in the Maya Render View
- Batch Rendering
Introduction
This is the "Getting Started Guide" that covers all of the steps required to start creating content for stereoscopic fulldome theaters using Autodesk Maya. This guide is designed to give artists an understanding of the manual node connections that are automated by the Domemaster3D Shelf in Maya.
Getting Started With the Domemaster3D Shader
Step 1. Creating the Base Domemaster3D Shading Network
Before we add the DomeAFL_FOV_Stereo
node to the scene we need to create the base shading network connections for the Domemaster3D shader. We are going to use the rob_lookup_background
shader to preview our dome control textures in the special "screen coordinate space". The rob part of shader name is due to the fact it was developed by Roberto Ziche.
Let's get started.
Add a new perspective camera to the scene.
To use the rob_lookup_background
shader we need to add a new camera to the scene. In the viewport, from the Panels menu select Perspective > New. This created a new camera. Let's change the name of the camera to robLookupCamera.
Rename the camera robLookupCamera.
We are going to use the Hypershade to create the custom shading network. Click in the perspective view and hold down the spacebar to display the hotbox. From the north zone, select the Hypershade/Render/Perspective layout.
Click in the Hypershade and tap the spacebar to maximize the view.
Select the Cameras tab to display a list of the active cameras in our scene. Drag the robLookupCameraShape node from the Cameras tab to the work area.
In the create bar click on the mental ray > lenses section. Click on the rob_lookup_background icon in the create bar to add the shader to the Hypershade work area.
Let's connect the rob_lookup_background
lens shader to the new camera. Using the middle mouse button drag the rob_lookup_background
node onto the robLookupCameraShape node. In the connect pop-up menu select default.
This has connected rob_lookup_background.message
to robLookupCameraShape.miLensShader
.
Connect a rob_lookup_background shader to the camera.
The next step is to create the texturing and screen space conversion nodes for the shading network.
In the create bar, click on the mental ray textures section. Add a mib_texture_filter_lookup
node to the work area. This node will merge the image data with the screen space UV coordinate system.
We are going to map a greyscale output from the mib_texture_filter_lookup node to the rob_lookup_background shader's greyscale tex attribute.
Connect a mib_texture_filter_Lookup
node to the rob_lookup_background
shader.
Using the middle mouse button drag the mib_texture_filter_lookup
node onto the rob_lookup_background
node. In the connect pop-up menu select Other...
In the connection editor expand the mib_texture_filter's
outValue attribute on the left side of the window and select the outValueR attribute. On the right side of the connection editor window select the tex attribute.
Click the close button in the connection editor to hide the window.
This has connected mib_texture_filter_lookup.outValueR
to rob_lookup_background.tex
.
Connect the mib_texture_filter_lookup node to the rob_lookup_background node using the connection editor.
Next we are going to add a mentalrayTexture node to the work area. This node will load the actual file texture for the separation map. In the textures section of the create bar click on the mentalrayTexture node.
Select the mentalrayTexture node in the Hypershade work area. In the attribute editor, click on the folder icon next to the Image Name field. Select the separation_map.png
image from the project's sourceimages folder and click open.
In the Hypershade work area drag the mentalrayTexture node onto the mib_texture_filter_lookup
node. From the connect pop-up menu select default.
This has connected mentalrayTexture.message
to mib_texture_filter_lookup.tex
Connect the mentalrayTexture node to the rob_lookup_background
shader.
Now let's connect the mental ray nodes required to create the screen space texture coordinates.
Let's add a mib_texture_vector
node to work area. In the create bar from the mental ray > Textures section, click on the mib_texture_vector
node.
Set up the mib_texture_vector
select space attribute.
Select the mib_texture_vector
node in the work area. In the attribute editor you will see an attribute called selspace. This attribute stands for "select space" and it allows you to choose the source space used for texture mapping. Change the mib_texture_vector
node's selspace value to screen. This setting allows us to project the separation map onto the camera using mental ray screen space UV coordinates.
Set the selspace attribute to screen
We need to add one more node to the work area. In the create bar from the mental ray > textures section, click to add a mib_texture_remap
node. In the Hypershade work area, use the middle mouse button to drag the mib_texture_vector
node onto the mib_texture_remap
node. From the connect pop-up menu select **Other... **
Connect the mib_texture_vector node to the mib_texture_remap node.
In the connection window select the mib_texture_vector
outValue attribute on the left and the mib_texture_remap input attribute on the right.
Use the connection editor to connect the mib_texture_vector
node to the mib_texture_remap node
Click the close button to hide the connection editor.
This has connected mib_texture_vector.outValue
to the mib_texture_remap.input
.
This image shows the node connections for the mib_texture_vector
and mib_texture_remap
nodes.
We have one last node to add to the work area.
Using the middle mouse button drag the mib_texture_remap
node onto the mib_texture_filter_lookup
node. From the connect popup menu select **Other... **
In the connection window select the mib_texture_remap
outValue attribute on the left and the mib_texture_filter_lookup
coord value on the right. Click the close button to hide the connection editor.
This is the connection editor view of the mib_texture_remap
to mib_texture_filter_lookup
connections.
Click the close button to hide the connection editor.
This has connected the mib_texture_remap.outValue
to the mib_texture_filter_lookup.coord
.
If everything is hooked up properly the mib_texture_filter_lookup
node should now display a crescent shaped preview icon.
This is an image of the node connections for the mib_texture_remap
and mib_texture_filter_lookup
nodes.
Let's cleanup the layout of the work area by clicking on the rearrange graph icon in the Hypershade toolbar. Click in the work area and press the A key on your keyboard to fill the view with the nodes.
With this shading network we can now preview the Domemaster3D screen space texture maps.
Let's see the results of the rob_lookup_background shader by doing a test render using the render view.
Tap the spacebar to return to the Hypershade / Render / Perspective layout.
Render the robLookupCamera.
In the render view from the Render menu, select Render > robLookupCamera. If the shading network is setup correctly we should see the black crescent shape from the separation texture map.
This is the result of rendering with the robLooupCamera.
In the next step we are going to add a stereo camera rig to our Maya scene and connect the custom texture maps to the domeAFL_FOV_Stereo
node.
Step 2. Creating a Stereo Camera Rig in Maya
It's possible to use the Domemaster3D shader with Maya's stereo camera rig. This setup makes it easy to animate the stereo camera in your scene and also allows you to preview your Maya renders in the render view using anaglyph 3D glasses.
Let's add a stereo camera rig to our scene.
In the perspective viewport select the Panels > Stereo > Create Stereo Camera menu item.
Let's add a stereo camera to the scene.
This is a closeup of the Stereo menu.
We now have a stereo camera rig to our scene. We need to edit the stereo rig's camera attributes so it is compatible with the Domemaster3D shader. From the Panels menu select Stereo > stereoCamera.
This is the view through the stereo camera viewport.
In the attribute editor make sure the stereoCameraCenterCamShape tab is selected. Scroll down to the Stereo section.
We need to modify the default stereo rig attributes to allow the DomeAFL_FOV_Stereo
shader to control the camera separation settings. Start by setting the Interaxial Separation to 0.0. Next we need to change the Stereo pop-up menu from Off-axis to Off. This will disable the standard stereo convergence settings.
Here are the attributes for the stereoCamera.
Let's change the realtime viewport's field of view attributes. In the attribute editor change the focal length to 15 millimeters so we have a wider field of view. This makes it easier to frame the shot. This field of view setting will only affect the realtime viewport in the perspective view. The domeAFL_FOV_stereo
shader will still control the angular fisheye field of view attribute at render time.
Step 3. Adding the domeAFL_FOV_Stereo Node
In this step we are going to add a domeAFL_FOV_Stereo
node and connect it to the stereo camera rig.
Click in the Hypershade and tap the spacebar to maximize the view.
The custom texture map shading network we created in step 1 is important for controlling the positioning of the stereoscopic effect on the fulldome screen and to reduce rendering artifacts that would be visible from the head turn feature at top of the fulldome screen.
In the cameras tab we need to select the left and right cameras used by the stereo camera rig and the robLookupCamera created in the previous step. Click in the cameras tab and hover your mouse cursor over the camera node icons to see the full length names of the cameras.
Select the robLookupCameraShape, the stereoCameraLeftShape and stereoCameraRightShape nodes.
Click the show input connections icon in the Hypershade toolbar. This is has added the nodes to the work area and displayed the node's input connections.
Add the selected cameras to the work area.
Let's add a domeAFL_FOV_stereo
node to work area. From the create bar select the mental ray > lenses section. Then click on the domeAFL_FOV_Stereo
icon to add the node to the work area.
Add the domeAFL_FOV_Stereo
node to the work area.
This node will be used for rendering the angular fisheye view for the left camera in the stereo rig. Click on the domeAFL_FOV_Stereo
node in the work area. In the attribute editor use the camera pop-up menu to set the camera view to Left.
For this tutorial we will leave the Camera's Separation value at 6 cm.
If you scale the size of the camera's transform node to make the icon larger in the perspective view, it will result in the camera scale having a direct multiplying effect on the current camera separation value.
Set the camera view to Left in the DomeAFL_FOV_Stereo
node.
Now we are going to connect a greyscale channel from the separation texture map shading network to the domeAFL_FOV_Stereo
node.
Using the middle mouse button drag the mib_texture_lookup
node onto the domeAFL_FOV_Stereo
node. From the connect pop-up menu, select Other...
Connect the mib_texture_filter_lookup node to the domeAFL_FOV_Stereo
node.
On the left side of the connection editor, expand the domeAFL_FOV_Stereo
outValue attribute and select outValueR. On the right side of the connection editor, select Cameras_Separation_Map
.
Use the connection editor to connect the mib_texture_filter_lookup
node to the domeAFL_FOV_Stereo
node
Close the connection editor.
This has connected mib_texture_lookup.outValueR
to domeAFL_FOV_Stereo.Cameras_Separation_Map
.
Here are the node connections for the mib_texture_filter_lookup
and domeAFL_FOV_stereo
nodes.
We're now going to connect a head turn texture map also known as the "Turn Multiplier" to the domeAFL_FOV_Stereo
node. To save time, let's duplicate the existing mib_texture_lookup
node's shading network.
Duplicate the shading network.
Select the mib_texture_lookup
node in the work area. From the Hypershade's Edit menu, select Duplicate > Shading Network.
Use the Duplicate Shading Network menu item to copy the existing nodes.
Let's clean up the view in the work area by rearranging the nodes. Click the rearrange graph icon in the toolbar.
We need to link the head turn map PNG texture to the mental ray texture node. Select the copied mentalrayTexture node in the work area. In the attribute editor, click the folder icon next to the image name field. We are now going to select the head turn texture map. In the open dialog select turn_map.png
and click open.
Let's relink the texture map in the attribute editor.
Select the turn_map.png texture in the sourceimages folder.
To force the node icon swatch to update lets reconnect the mentalrayTexture node to the mib_texture_filter_lookup node. Click on the line connecting the two nodes and press the delete button. Using the middle mouse button drag the mentalrayTexture node onto the mib_texture_filter_lookup
node. From the connect pop-up, select default.
Connect the turn-map to the domeAFL_FOV_Stereo
node.
Now let's connect this shading network to the domeAFL_FOV_Stereo
node. Using the middle mouse button drag the head turn map's mib_texture_filter_lookup
node onto the domeAFL_FOV_Stereo
node. From the connect pop-up menu, select other...
This is a view of the Connection editor showing the connections from the mib_texture_filter_lookup node to the domeAFL_FOV_Stereo
node.
On the left side of the connection editor, expand the outValue attribute and select outValueR. On the right side of the connection editor, select Head Turn_Map
.
Close the connection editor.
This has connected mib_texture_filter_lookup.outValueR
to domeAFL_FOV_Stereo.Head Turn_Map
.
This is a view of the node connection between the mib_texture_filter_lookup node and domeAFL_FOV_Stereo
node.
Let's clean up the view in the work area by rearranging the nodes. Click the rearrange graph icon in the toolbar.
Let's connect this lens shader node to the left camera in the stereo rig. Using the middle mouse button drag the domeAFL_FOV_Stereo
node onto the stereoCameraLeftShape node. From the connect pop-up menu, select default.
Connect the domeAFL_FOV_Stereo
node to the stereoCameraLeft node.
This has connected domeAFL_FOV_Stereo.message
to stereoCameraLeftShape.miLensShader
Let's select the domeAFL_FOV_Stereo
node and duplicate it for the right camera.
This is a view of the domeAFL_FOV_Stereo
to stereoCameraLeft node connections.
Select the domeAFL_FOV_Stereo
node in the work area and from the Hypershade's Edit menu, select Duplicate > With Connection to Network. This has duplicated the domeAFL_FOV_Stereo
node and linked it to the existing custom texture map shading network.
Duplicate the nodes using the With Connections to Network menu item.
This is a view of the two domeAFL_FOV_Stereo
nodes.
This node will be used for the right camera in the stereo rig. Click on new the domeAFL_FOV_Stereo
node in the work area. In the attribute editor use the Camera pop-up menu to set the camera view to "Right".
This is the right camera view for the domeAFL_FOV_Stereo
node.
Let's connect this lens shader node to the right camera in the stereo rig. Using the middle mouse button drag the new domeAFL_FOV_Stereo
node onto the stereoCameraRightShape node. From the connect pop-up menu, select default.
This has connected domeAFL_FOV_Stereo.message
to stereoCameraRightShape.miLensShader
Connect the right domeAFL_FOV_Stereo
node to stereoCameraRightShape node
Select the two domeAFL_FOV_Stereo
nodes in the work area. Click the input and output connections icon in the Hypershade toolbar to regraph the scene.
Regraph the shading network.
This is the completed fulldome stereo camera rig with shared texture connections.
This is the finished Domemaster3D shading network.
Step 4. Rendering a Domemaster Stereo Anaglyph Preview in the Maya Render View
In this step we are going to add a cube to the scene and render it as a stereoscopic domemaster image.
Switch back to the Hypershade / Perspective / Render layout by tapping the spacebar over the work area.
Let's add a polygon cube to the scene as a test object. We need to start by disabling interactive creation so we can specify the exact size of the polygon cube.
From the Create menu select Polygon Primitives >Interactive Creation. Now we can create an accurately sized polygon cube.
Disable interactive creation.
From the Create menu select Polygon Primitives > Cube with options.
Select the create polygon primitives, cube with options menu item.
In the polygon cube options window set the width and height and depth to 300 units. Click the Create button.
Create a square cube with a dimension of 300 units in size.
Let's attach a texture to the cube. Right-click in the perspective view, and from the marking menu select Assign New Material...
In the Assign New Materials window, select the Lambert material. We now have a Lambert surface material applied to the polygon cube.
Select the Assign New Material... item.
In the attribute editor rename the material to checkerLambert.
Let's connect the PNG file texture. In the attribute editor click on the map icon next to the color attribute.
Map a texture to the new checkerLambert material.
In the Create Render Node window, select the File node. A file node has been added to the shading network.
Assign a file node to the material.
Let's add a PNG texture to the file node using the attribute editor. Click on the folder icon next to the image name field.
Select the file texture.
In the open dialog, select luminance-cube-texture.png and click open.
Select the file texture luminance-cube-texture.png.
Press the 6 key to switch to smooth shaded mode.
This is a view of the textured polygon cube.
We need to add a light to scene. From the Create menu, select Lights > Point Light.
Use the create menu to add a point light to the scene.
In the Attribute editor set the Point Light's intensity to 1.5 and press enter.
Edit the point light intensity attribute.
In the perspective viewport let's enable the light. From the Lighting menu select Use All Lights.
We need to reposition the stereoCamera before we render the scene. Open the outliner and select the stereoCamera.
Select the stereoCamera in the outliner.
In the channel box set the camera's translation and rotation values to 0.0. You can now close the outliner.
Zero out the stereoCamera transforms using the channel box.
Before we render the scene we need to go over the render settings.
Click the render settings icon in the toolbar. Make sure the mental ray renderer is selected. Scroll down in the common tab of the render settings window. In the Renderable Camera's section make sure the Renderable Camera popup menu is set to stereoCamera ( Stereo Pair ).
In the render settings set the renderable camera to the stereoCamera.
When you batch render the sequence Maya will automatically create two folders in the images directory - one for the left camera images and one for the right camera images. Each of the frames in your animation will result in a right and left image rendered to the appropriate folder.
Let's set the image size to a 2K resolution output (2048 x 2048) with a square 1:1 aspect ratio for our test render. In the Image Size section choose the 2K Square preset. Close the render settings window
Set the image size to 2048x2048.
To speed of the performance of the render view, lets use the 50% resolution setting. In the render view Options menu, select Test Resolution > 50% settings ( 1024x1024).
In the render view set the test resolution to 50 percent.
Let's maximize the render view. Click in the render view and tap the space bar to go full-screen.
Render the stereo camera.
We are now ready to render the stereo camera. In the render view from the Render menu select Render > Stereo Camera. This will automatically render the left camera view then the right camera view. The resulting images will be composited together to give an anaglyph stereoscopic preview.
This is a closeup image of rendering the stereo camera.
You can view the stereo rendering as an anaglyph image directly in the render view.
Once the render is complete you can choose a stereoscopic display method for the preview. From the Display menu select the Stereo Display menu. You can choose between the following stereoscopic formats: anaglyph, luminance anaglyph, freeview parallel, freeview crossed, left only or right only.
You can switching stereo display modes in the render view.
This is an image showing the stereoscopic parallel freeview display mode.
This is an image of the Freeview Parallel stereo display mode.
Let's save the scene. From the File menu select Save scene.
Let's save the current Maya scene.
Give the scene a file name.
Batch Rendering
The stereo camera rig allows you to render stereoscopic domemaster image sequences using Maya's Batch Render command. If you want to render an animation set the output to the name.number.extension format in the render settings window.
Switch to the Rendering menu set.
From the Render menu select Batch Render with options.
Select the batch render menu item.
In the mental ray Batch Render Options window click the batch render and close button.
Click the Batch render and close button.
When the batch render completes, switch to your desktop and open the images directory for your current Maya project. Maya automatically created folders called stereoCameraLeft and stereoCameraRight.
You can view the completed renderings in the images directory.
Viewing the renderings using imf_disp
You can use the mental ray image viewer imf_disp that comes with Maya to view the stereo renderings.
Open imf_disp program that is located in the Maya / mental ray / bin folder. From the File menu select Open Stereo...
Open the stereo images in the imf_disp utility.
In the open dialogue select the two stereo images. You can fit the stereo images to your screen by selecting the View > Zoom > Zoom to Fit Window menu item or by pressing the W key on your keyboard.
Zoom the view.
The imf_display program has an exposure and gamma control you can use to adjust the brightness of the image.
You can adjust the exposure and gamma in imf_disp viewer as you are previewing the images in stereoscopic 3D.
You can change the stereo display mode by selecting the View > Stereo Display menu item.
This menu shows the available imf_display stereo display modes.
Conclusions
Congratulations for making it through this tutorial! There was a lot of stuff to cover but you have now rendered your first stereoscopic Domemaster image. We have gone over the steps required to make all the connections for a Domemaster3D shading network and how to create a fulldome stereo camera rig.