-
Notifications
You must be signed in to change notification settings - Fork 43
Maya Domemaster3D Tips and Tricks
- Setting up a new Maya Project
- Controlling Stereoscopic Depth
- Rendering 2D and 3D with the Fulldome Stereo rig
- Creating domeAFL Optimized Surface Materials
- Native Maya Surface Materials Blurry Streak Fix
- Using Mental Ray Physical Sun and Sky
- Mental Ray Subsurface Shading and Lens Shaders
- Maya Fluid Effects and Mental Ray Lens Shaders
- Animating Lens Shader Attributes
When you set up a new Maya project you need to add either a Fulldome or LatLong camera to the scene using one of the Domemaster3D Shelf tools. The shelf tools will automatically link in a set of screen space stereo control texture maps to the lens shaders that allow you to sculpt the stereo depth settings. The control texture maps are stored in the Domemaster3D shader's sourceimage folder by default:
After you install the Domemaster3D shader for Maya you will find the default images in the C:\Program Files\Domemaster3D\sourceimages folder
on Windows, or the /Applications/Domemaster3D/sourceimages
folder on macOS, or the /opt/Domemaster3D/sourceimages
folder on Linux.
If you used the Domemaster3D shelf tools to add either a fulldome stereo or LatLong stereo camera rig you will also notice a set of entries in the Pre Render MEL and Post-Render MEL section in the Render Settings window. These settings are used to prepare the stereo camera rig for rendering and the attributes are explained in more detail on the Fulldome or LatLong shader's wiki pages in the section titled Pre and Post Render MEL Scripts
.
The default domeAFL_FOV_Stereo
turn and separation texture maps are called:
- turn_map.png
- separation_map.png
- head_tilt_map.png
These textures are automatically connected to the Domemaster3D stereo camera rig when you use the Fulldome Stereo Rig shelf tool.
The "turn_map.png
" image is used to take care of the stereoscopic effect at the zenith area directly above the viewers head. The texture map removes a swirl effect that would be present without the turn control setting.
The turn map also takes care of the area 180 degrees behind the viewer where the stereoscopic effect would be reversed if the viewer rotated their head to look at the back of the fulldome screen.
The texture is applied in screen space coordinates which means it controls the effect in the final fisheye image.
The "separation_map.png
" image is the default separation texture that controls the area on the screen where the stereoscopic effect is visible.
The texture is applied in screen space coordinates which means it controls the stereoscopic effect in the final fisheye image. The white area in the texture map is rendered without any stereoscopic effect. If you are creating your own separation texture maps you will want to blur the transition between the white "monoscopic" region and the black "stereoscopic" region in the texture map to smooth the transition zone.
The head_tilt_map.png image is the sample texture for the head tilt control in the domeAFL_FOV_Stereo
shader. By default the texture isn't connected to the shading network when you use the Fulldome Stereo Rig shelf tool.
The default mia_material textures for a domemaster shading network are called:
- bumpChecker.iff
- Checker.iff
Note: You can edit the name of the default textures by updating the variables in the Domemaster3D shader's python scripts.
The Checker.iff texture is applied to the diffuse channel of the domemaster color mia_material when you use the Color Material or Color + Bump Material shelf items.
This is a rendering of the default Color Material on a sphere:
The bumpChecker.iff texture is applied to the bump map shading network when you use the Color + Bump Material shelf item. The texture is saved as a 16-bit IFF file for smoother gradations.
This is a rendering of the default Color + Bump Material on a sphere with a bump effect factor of 5:
Note: If you want to increase the bump map strength you need to select the mib_passthrough_bump_map node and change the bump effect factor attribute in the attribute editor.
If the Domemaster3D default texture maps become unlinked in current Maya scene you may get a mental ray missing texture warning that happens when a new "mentalraytexture" node is used without a connected file texture.
If the default textures are missing when you open a scene you will get a mental ray warning when you try and render a scene that uses the textures.
// Warning: (Mayatomr.Shader) : color_mentalrayTexture1: referenced texture file "{TEXS}/sourceimages/separation_map.png" doesn't exist, ignored //
// Error: (Mayatomr.Output) : file error: {TEXS}/sourceimages/separation_map.png //
// Error: (mental ray) : /sourceimages/separation_map.png: can't open file for reading (No such file or directory) //
// Error: (mental ray) : {TEXS}/sourceimages/separation_map.png: registry entry {TEXS} not found //
// Error: (mental ray) : {TEXS}/sourceimages/separation_map.png: registry entry {TEXS} has no value //
// Error: (mental ray) : {TEXS}/sourceimages/separation_map.png: registry entry {TEXS} not found //
// Error: (mental ray) : {TEXS}/sourceimages/separation_map.png: registry entry {TEXS} not found //
To fix the error you need to make sure the Domemaster3D textures are in the C:\Program Files\Domemaster3D\sourceimages
folder on Windows, or the /Applications/Domemaster3D/sourceimages
folder on macOS, or the /opt/Domemaster3D/sourceimages
folder on Linux. It is possible to copy the default textures into your current project's sourceimages directory and tell Maya to refresh your scene.
If you get a missing texture error you can refresh your active scene either by switching to a new Maya scene using the File > New Scene menu item and then re-opening your current scene, or by quitting and restarting Maya.
This is a screenshot of the "domeAFL_FOV_Stereo
" shader in the Maya attribute editor.
The Dome Radius value acts as a fulldome equivalent to the zero parallax zone in stereoscopic imaging. The Dome Radius will allow you to control the convergence of the left and right cameras. This radius is a distance measurement in scene units from the camera. The default value is 360 units.
Notes:
- If you want an object to come out of the screen at the audience place the object closer to the camera than the dome radius distance.
- Objects near the dome radius distance will appear to have the same depth as the fulldome screen.
- Objects located past the dome radius distance will appear to exist beyond the depth of the fulldome screen.
Tip: It is possible to key-frame animate the dome radius value if you are flying the stereo camera through a long sequence that needs to adjust the zero parallax zone for viewer comfort.
It is also possible to use a render "layer override" with Maya's render layer system to change the dome radius and cameras separation values. You might want to do this to "sculpt" the stereo depth in a scene to adjust the amount of stereo displacement between the foreground, midground, and background elements.
The Cameras Separation value controls the stereo base of the left and right cameras. This value is measured in scene units.
The default setting is 6 cm.
You can freely adjust the cameras separation value until you get the correct amount of stereoscopic effect in your rendered image. Typically the cameras separation value will change depending on the scale of the scene.
Example: A microscopic scene will have a different setting than an indoor scene, or an interplanetary scene.
Tip: You can key-frame animate this attribute if you are traveling in a single shot from a back yard scene on earth to exploring planets in outer space.
When you want to make the camera's icon larger in the perspective viewport most artists will select the camera icon and change the Camera's ScaleX/ScaleY/ScaleZ attributes.
Unfortunately this will also effect the "DomeAFL_FOV_Stereo
" node's calculation for the camera separation value.
If you want to make the camera's icon in the Maya viewport larger it is important to select the camera and change the camera's Locator Scale attribute found in the Object Display section of the Attribute Editor.
If you want to change the scale of the cameras in the stereo rig you will have to change the locator scale attribute for the center, left, and right cameras.
This is the effect of properly scaling the Camera's Locator Scale attribute. You have a nice, easy to select camera and the stereo base calculations will work properly.
The Separation Multiplier attribute controls the area on the fulldome screen where the stereoscopic 3D effect is visible through the use of a custom texture map.
The Separation Multiplier attribute supports either a ramp texture or a mental ray file texture based shading network. The only requirements for the texture is that it provides a grayscale input and it has to be applied in screen space coordinates.
To make it easier to use the Separation Multiplier attribute there are two "screen space" tools in the Domemaster3D shelf.
The Screen Space Ramp shelf item creates an editable gradient using the Maya ramp texture node. This is a quick way to keep the stereoscopic effect on the front part of the fulldome screen.
By default a new ramp node is connected to a "rob_lookup_background
" node. This allows the effect to be previewed in the render view. When you want to use this shading network with the "DomeAFL_FOV_Stereo
" node you can connect a greyscale output from the ramp node to the "DomeAFL_FOV_Stereo
" nodes Separation Multiplier input.
This is a screenshot of the Screen Space Ramp nodes in the Hypershade work area before they are connected to the DomeAFL lens shader.
This is an image with the ramp texture set to have the stereoscopic 3D effect visible on the front half of the fulldome screen. This setting will cause the stereoscopic depth effect to be cancelled out on the screen area behind the viewer.
The selected position and selected color attributes are the primary controls for editing the location of the screen space ramp. By default a V-axis ramp is used.
The Screen Space Texture shelf item creates a mental ray texture shading network. The default texture connected to the shading network is the image sourceimages/separation_map.png
By default a new screen space texture network is connected to a rob_lookup_background
node. This allows the effect to be previewed in the render view. When you want to use this shading network with the "DomeAFL_FOV_Stereo
" node you can connect a greyscale output from the "mib_texture_filter_lookup
" node to the "DomeAFL_FOV_Stereo
" nodes Separation Multiplier input.
This is a preview of a typical separation texture map before it is connected to the DomeAFL lens shader:
This is a screenshot of the Screen Space Texture nodes in the Hypershade work area.
When you review your stereoscopic 3D edits, try and make sure the transition isn't too jarring for the viewer when you switch from a wide shot to a medium or closeup shot.
Feel free to art direct the dome radius value to meet the needs of your stereoscopic scene. The dome radius default value is just a starting point. For example if you want to bring an object out of the screen and closer to the viewer you might have to change the settings for both the dome radius and cameras separation to maximize viewer comfort.
As a general stereoscopic tip, don't push more than 30% of the scene outwards into the audience. Objects that dramatically and regularly pop out of the screen towards the viewer can cause eye strain so the effect should be used sparingly.
For maximum viewer comfort try and keep most of the background scene elements further away from the camera than the dome radius distance.
When you are creating stereoscopic renderings care should be taken to make sure the stereobase of the cameras (the camera separation value) isn't too large for the particular scene.
If you are creating a macro shot or ECU (extreme closeup) shot of an object you will have to reduce the camera separation value below the standard "human eye" separation value of 6 cm.
The nearest object in the scene will typically limit the maximum "safe" camera separation value.
If you are interested, there are several stereo calculator programs and utilities that offer formulas for computing comfortable stereo viewing parameters.
Hyperstereo is the term for creating images with a larger stereobase (camera separation) than the normal human eye spacing of approx 6 cm.
If there are no objects located close to the camera you are free to experiment with increasing the camera separation value to create larger stereoscopic depth effects such as hyperstereo. This can be useful in scenes with distant backgrounds like a mountain ranges on the horizon, or in an outer space scene with distant planets and moons.
The only downside with creating hyperstereo renderings is the viewer's perception that they are giant's looking down at a miniature model of the world.
If you use Maya for fulldome renderings you might find it handy to know that you can use the same fulldome stereo camera rig to render both the 2D and 3D images. You don't have to switch between using the "domeAFL_FOV
" and "domeAFL_FOV_stereo
" lens shaders.
The benefit of this technique is existing fulldome camera animation doesn't have to be recreated again when you switch from 2D to 3D.
The default Fulldome Stereo rig that is created using the stereo camera tool in the domemaster3D shelf uses the "DomeAFL_FOV_Stereo
" shader. The shelf item automatically adds a parented camera with a center camera view, and left & right cameras to the scene.
You can render the monoscopic 2D center camera view in the Maya render settings by selecting the renderable camera called "DomeStereoCamera".
You can render the stereoscopic 3D left and right stereo pair images by selecting the camera labeled "DomeStereoCamera (Stereo Pair)" in the render settings window.
The domeAFL shader usually works well with mental ray. However the most common rendering issue experienced with the domeAFL shader is known as a "blurry streaky" line artifact.
Note: This artifact has been fixed in the new mental ray 3.14 for Maya update using a new ray differential based texture sampling. If you are running mental ray version 3.14 or newer you no longer have to worry about the blurry streak artifact when you have Mipmap filtering enabled on your Maya file textures, and in the Extra Attributes the mental ray elliptical filtering option enabled.
This blurry artifact occurs near the spring line on a fulldome rendering when a default Maya "file" texture node is used. The rendering artifact is caused by the Maya file nodes' mip-map texture filtering. The best solution to this bug is to switch from using a Maya file node to a mental ray file texture node.
This is a cropped fisheye rendering of a planet that is textured using a Lambert material and a maya file texture. The blurry streak effect is visible on the left side of the planet.
This is a cropped fisheye rendering of a planet that is textured using a mia_material and a mental ray file texture. The blurry streak effect is gone and the planet renders normally.
The mental ray file texturing node connections can be tedious to set up so three new material presets were added to the Domemaster3D shelf.
The Color Material preset adds a "mia_material_x_passes
" to the scene and uses a mental ray file texture node as the diffuse color texture.
The Color + Bump Material preset adds a "mia_material_x_passes
" to the scene and uses a mental ray file texture node as the diffuse color texture and sets up a mental ray bump map shading network.
The "mia_material_x_passes
" shader has a slightly different feature set than the previous "mia_material
" shader.
If you want to connect a mental ray native bump map shading network you need to expand the "Advanced" section in the Attribute Editor and set the Bump Mode to zero. Once the setting is modified the bump maps show up on the material.
The mental ray bump node connections are:
mib_texture_vector.outValue -> mib_texture_remap.input
mib_texture_remap.outValue -> mib_passthrough_bump_map.coord
mib_bump_basis2.u -> mib_passthrough_bump_map.u
mib_bump_basis2.v -> mib_passthrough_bump_map.v
mentalrayTexture.message -> mib_passthrough_bump_map.tex
mib_passthrough_bump_map.outvalue -> mia_material_x_passes.bump
Note: The "mib_passthrough_bump_map
" factor attribute controls the bump depth.
If you need to use native Maya file nodes and Maya surface materials with the DomeAFL shader you can use an alternate solution to fix the "blurry streaky" line artifact. The fix is to use two different field of view values for the renderings - one in the DomeAFL node and one in the camera's attribute settings.
This sounds weird the first time you hear it but it does fix the problem!
When a scene is rendered with the DomeAFL angular fisheye shader, the FOV (field of view) for the rendering is controlled by the DomeAFL node in the attribute editor. This means we can change the value in the camera attribute window and it won't effect the camera framing in the final render.
For example if the domeAFL node was set to render a fisheye image with a 180 degree FOV, and your DomeAFL based perspective camera was set to display the real-time perspective view with a 4 mm setting you might see the "blurry streaky" line artifact in your mental ray renders.
This is the camera set to use a 4 mm FOV setting for the real-time viewport.
If we keep the DomeAFL node at a 180 degree FOV and changed the camera's FOV setting to 500 mm the "blurry streaky" line artifact disappears because the high zoom value on the FOV attribute seems to changes the way mental ray calculates mip-map texture filtering for the maya file texture nodes.
The only major downside for this technique is that the realtime viewport shows a preview with a highly zoomed 500 mm field of view. To fix the realtime view's field of view we can change the FOV setting only at render time using the pre and post render MEL script option in the Render Settings window.
Here are two simple MEL commands that will change the field of view when you render and image and then set the field of view back to normal afterwards.
Open the Render Settings window. Scroll down to the bottom of the window and expand the Render Options section.
The DomeAFL_FOV_Stereo shader has a Pre and Post render MEL script function that takes care of the blurry line fix and also switches the camera rig's stereo separation from the hardware OpenGL view, to the mental ray / "domeAFL_FOV_Stereo
" shader's internal stereo controls.
When the stereo fulldome camera shelf tool is used to add a new camera rig to the scene the following Render Settings window scripts are set up automatically:
Pre Render MEL:
source "domeRender.mel"; domemaster3DPreRenderMEL();
Post Render MEL:
source "domeRender.mel"; domemaster3DPostRenderMEL();
(These settings are found in the Render Settings window's Common Tab, under the Render Options section):
If you are using a 2D fulldome lens shader like the "domeAFL_FOV
", or "domeAFL_WxH
" shaders, you can use a custom MEL render time script to adjust the FOV and fix the Blurry streak artifact. If your fulldome camera was called "domeAFL_FOV_Camera1
" you would open the render settings window, scroll down to the Render Options section and do the following:
Type the following line in the Pre render MEL field:
setAttr "domeAFL_FOV_CameraShape2.focalLength" 500;
Type the following line in the Post render MEL field:
setAttr "domeAFL_FOV_CameraShape2.focalLength" 4;
I would like to thank Jason Fletcher of the Charles Hayden Planetarium for his guidance and help testing the DomeAFL mia_material presets and the DomeAFL field of view override tip.
The domeAFL and "domeAFL_FOV_Stereo
" shaders are compatible with the mental ray Physical Sun & Sky system in Maya. The Physical Sun and Sky feature allows artists to create outdoor renderings with a realistic sky, a visible sun disc, and final gather based lighting and shadows.
The "domeAFL_FOV
", "domeAFL_WxH
", and Fulldome Stereo rig tools in the Domemaster3D shelf now make the correct lens shader connections to support the mental ray Physical Sun and Sky system.
If you are manually connecting the domeAFL shaders to a camera the solution to enable mental ray sun & sky support is to switch from connecting to the "camera.miLensShader
" input to use the "camera.miLensShaderList
" input.
This is done because the primary lens shader connection is overwritten with a "mia_exposure_simple1
" node by Maya's automatic mental ray Physical Sun and Sky "create" button.
If you don't want to use the camera tools in the Domemaster3D shelf, an alternate way is to connect a domeAFL shader to the "camera.miLensShaderList
" input.
This first step is to start by adding the mental ray Physical Sun and Sky system to your Maya scene.
Open the render settings window.
Switch to the Indirect Lighting tab.
In the Environment section, look for the label text Physical Sun & Sky.
Click on the "Create" button to add the Physical Sun & Sky system to your scene.
Next you need to connect the DomeAFL lens shader to the "miLensShaderList
" input. To do this select the camera in your scene scene.
Open the attribute editor window and scroll down to the mental ray section.
Expand thee Lens Shaders section and click the "Create" button.
In the Create Render Node window select either the "DomeAFL_FOV
", "DomeAFL_WxH
", or "DomeAFL_FOV_Stereo
" lens shader.
The DomeAFL lens shader is now connected to the "`miLensShaderList'~ input.
This is a view of the correct lens shader connections with a "DomeAFL_FOV
" lens shader and the Physical Sun & Sky system active.
It's recommended to use a "misss_physical
" material if you want to have correctly rendered subsurface shading when using a mental ray lens shader in Maya / 3DS Max / Softimage.
The other mental ray SSS materials like "misss_fast_simple
" and "misss_fast_skin
" use a screen space optimization that calculates the subsurface shading using the camera's original field of view before the lens shader view changes are know. This can cause the subsurface shading effect to fade off on the edge of objects.
In recent versions of Maya, the "misss_physical
" shader can be found in the Hypershade's "Create Bar" under the mental ray > Legacy folder.
Update: There is now a zenith mode camera rig preset available using the Domemaster3D > Dome Cameras > LatLong Stereo Zenith Camera menu item that is accessible in Maya's Rendering menu set.
Mental Ray lens shaders can have a dark streaky line artifact occur when you are rendering with a camera inside a Maya Fluid Effects volume. If you are rendering with the LatLongStereo shader you can reduce the visibility of the artifact with the help of the LatLongStereo shader's Zenith Mode checkbox.
To compare the difference with the Zenith Mode enabled/disabled, lets add a Maya Fluid Effects 3D container to a Maya Scene. Switch to the Dynamics menu set in Maya. From the Fluid Effects Menu, select the Create 3D Container menu item.
Change the scale of the fluid1 object to a ScaleX/ScaleY/ScaleZ value of 10. Also translate the fluid1 container up 6 units on the Y axis so the camera is inside the fluid.
To fill the fluid effects container with a sample value, open the Attribute Editor, and apply the skyFog preset to the fluidShape1 container.
Then add a LatLongStereo camera rig to the scene using the Domemaster3D shelf.
Start by selecting the base LatLongStereoCamera camera rig object in the outliner.
Since the Zenith Mode checkbox is turned OFF by default, when you do a rendering you will see an image with a lens shader artifact like this:
Select the center camera's lens shader in the attribute editor window by clicking on the Center_LatLong_Stereo
tab in the attribute editor. Scroll down in the Center_LatLong_Stereo
settings and turn "ON" the Zenith Mode checkbox.
When you enable the Zenith mode, mental ray will render the camera rig with an orientation that faces the camera upright so it looks upwards on the Y axis and this moves the lens shader artifact into a 1 pixel high band that is barely noticeable along the center of the horizontal axis in the rendering.
Since the Zenith Mode checkbox will render the camera in an upright position, we need to rotate the camera rig's transform node with a Rotate X 90 value to get the same look as the default LatLong Stereo shader has with the Zenith Mode disabled.
Now that we have the LatLongStereo camera rig and the fluid effect container in the scene, the perspective viewport should look like this:
If we do a render at this point, the image looks a lot better. The lens shader artifact is greatly reduced and is a lot less visible:
If you want to be able to keyframe animate lens shader attributes in Maya 2016+ you need to open the Maya Preferences window and disable parallel evaluation.
This is done by going to the Windows > Settings/Preferences > Preferences menu item.
In the Preferences window click on the Settings > Animation section on the left side of the view. Then in the main part of the preferences window under the Evaluation heading set the Evaluation mode to DG.
Click the "Save" button to accept these changes.
To place a keyframe on a lens shader attribute, select the "center_LatLong_Stereo
" item in the Hypershade's Utility tab.
Then open the Channel Box and right click on the attribute you want to animate. In the contextual menu select the Key Selected menu item.
If you want to use MEL scripting to manually set keyframes on the lens shader attributes you can use a code snippet like this:
// Set keyframes on the current LatLong FOV settings:
setKeyframe "center_LatLong_Stereo.FOV_Vert_Angle";
setKeyframe "center_LatLong_Stereo.FOV_Horiz_Angle";
// Set a Keyframe on the camera separation attribute
setKeyframe "center_LatLong_Stereo.Cameras_Separation";
// Set a Keyframe on the zero parallax distance
setKeyframe "center_LatLong_Stereo.Parallax_Distance";