5.5 Miscellaneous Guidelines
| 5.5.1 Dynamics Animation Rendering | ||
| 5.5.2 Using Atmosphere Shaders | ||
| 5.5.3 Textures In The Hypershade | ||
| 5.5.4 File Path Expressions | ||
| 5.5.5 Automatic File Output Control | ||
| 5.5.6 Hypershade translation quirks |
5.5.1 Dynamics Animation Rendering
3Delight for Maya could change the current time while rendering in two cases: when rendering a frame sequence (obviously) and when motion blur is enabled. If motion blur is requested, the blurred objects need to be sampled a number(12) of times during the frame's interval in order to detect the extent of their movement. This means that the current time will move a number times to sample the movement, and then jump back to the current frame once the rendering is done.
Since dynamics are computed incrementally(13) the time jumps introduced by 3Delight for Maya may yield consistent results. To avoid this problem, the dynamics computations need to be exactly the same for a given frame, regardless of what was the previously played frame. One way to achieve this is to cache the dynamics results. It is highly recommended to use Maya disk caching system when working with a scene that contains dynamics. Refer to the Maya documentation for more details about this; look into the Solvers and caching book in the Dynamics -> Dynamic and Effects section.
5.5.2 Using Atmosphere Shaders
Atmosphere shaders in RenderMan are used to compute the appearance of the volume between the camera and the object closest to it. This means that if there are no objects facing the camera at a given point in the camera's field of view, no atmosphere shader will be applied. Following this basic principle, here are some tips using atmosphere shaders, such as fog or smoke:
- Atmosphere shaders can be attached to any geometric objects using the shader assignment panel (see section Assignment Panel Components).
- If the atmosphere shader effect is needed everywhere in the camera field of view, create an object that will encompass all scene objects (including the render camera and the light sources), such as a cube or a sphere, and apply the atmosphere shader to it. This will ensure that the atmosphere shader is applied everywhere where there would be nothing visible to the camera.
- Attach the atmosphere shader to any object that the atmosphere shader effect is desired between that object and the camera. Conversely, it is possible to exclude the volume between a given object and the camera from the atmosphere computation simply by not attaching the atmosphere shader to that object.
- An easy way to apply an atmosphere shader to every geometric object in the scene is to create a shader collection and use the Override shaders section to specify the atmosphere shader to be used for all objects.
5.5.3 Textures In The Hypershade
If an object is shaded using an Hypershade shading network that uses a texture file (via a node such as the File 2D texture node), 3Delight for Maya will first convert the texture to 3Delight's texture file(14), and then use this converted file for rendering. It is possible to prepare the texture file manually in order to avoid this automatic conversion completely by using the tdlmake utility. The prepared texture file should have the `.tdl' extension. It can then be used directly in an Hypershade node such as the File 2D texture node.
IMPORTANTIt is recommended to use the `-preview' option of
tdlmake; doing so will create an embedded thumbnail that Maya can display as a texture preview image.
5.5.4 File Path Expressions
When an attribute that specifies a file path contains a relative path, the path will be considered relative to the current Maya project directory. This path can contain various tokens; this allows the path to dynamically change to reflect the current value of a given token. The following tokens can be used in any file path:
- ` $VAR'
- The value of the environment variable `VAR' will replace `$VAR' in the path.
- ` %VAR%'
- The value of the environment variable `VAR' will replace `$VAR' in the path.
- ` ~'
- The value of the
HOMEenvironment variable will replace the tilde character. - ` @'
- The current frame number will replace the @ character.
- ` #'
- The current frame number, padded to form a 4 digits number, will replace the # character.
- ` {<frame_num_char><operator><operand>}'
- Simple expressions to produce a frame number can also be used as a part of the file name. The expression must be enclosed in curly braces. The expression components are:
- ` <frame_num_char>'
- A character that represents the current frame number. `@' will produce the current frame number, and `#' will produce the same current frame number, padded to form a 4-digits number.
- ` <operator>'
- An arithmetic operator. Valid operators are: `+ - * / %'.
- ` <operand>'
- A integer or floating point number.
{#-10} {@*2.5} {#%5} - ` `MEL command`'
- The string enclosed in back quotes is evaluated as a MEL command and gets replaced with the command's result.
- ` <layer>'
- This string will be replaced with the currently rendered Maya render layer.
- ` <project>'
- This string will be replaced with the path to the current Maya project directory.
- ` <pass>'
- This string will be replaced with the name of the render pass node used for rendering.
- ` <shape_name>'
- This string will be replaced with the long name of the attached shape. This tag can currently only be used in light attributes nodes.
- ` <scene>'
- This string will be replaced with the name of the scene.
- ` <ext>'
- This string will be replaced with the file extension. File extensions are expanded for RIB files, shadow map files, and any file output by a display driver.
- ` <camera>'
- This string will be replaced with the name of the camera shape being used for rendering.
- ` <fragment_set>'
- This string will be replaced with the name of the object set used by the RIB fragment being output. It is valid only in render pass rib fragment filename attributes.
- ` <aov>'
- This string will be replaced with the name of the variable being output in the display. It is valid only in render pass display filename attributes.
- ` <output_variable>'
- This string is deprecated in favor of `<aov>'.
5.5.5 Automatic File Output Control
Some files are automatically generated by 3Delight for Maya. The destination directories for these files are defined in the Maya project. Like other Maya project settings, relative paths will be made relative to the project directory.
It is possible to prepend all of the 3Delight for Maya project directories that produce temporary files with a path assigned to the _3DFM_OUTPUT_PATH environment variable. Note that this variable needs to be defined before Maya is launched and does not apply to the templates project setting.
The available 3Delight for Maya project directories are:
- 3Delight Fur Files
- 3Delight for Maya needs to generate a geometry file for each Fur Feedback node visible in the scene. These files are saved under the folder specified in the 3Delight Fur Files project setting. If the _3DFM_FURFILES_PATH environment variable is defined, its value will be used (and thus will override the directory specified in the 3Delight Fur Files project setting). This project setting is also used to store RIB file produced by the Shave and a Haircut plugin in some cases. Refer to Shave and a Haircut Tips.
- RIB Fragments
- This project setting specifies the folder where RIB fragments will be saved. If the _3DFM_RIBFRAGMENTS_PATH environment variable is defined, its value will be used (and thus will override the directory specified in the 3Delight RIB Fragments project setting). See RIB Fragments for details about their purpose.
- 3Delight Shaders
- When an object has no RenderMan shader attached to it, 3Delight for Maya will attempt to translate any Hypershade shading network attached to that shader to RenderMan shaders, which are then used in the rendering. This process generates shader source files, which are stored in a `src' directory. These source files are then compiled into a shader and the compiled shader files are stored under the `OBJ' directory. Both the `src' and `OBJ' folders are created under the directory specified in the 3Delight Shaders project setting. If the _3DFM_SHADERS_PATH environment variable is defined, its value will be used (and thus will override the directory specified in the 3Delight Shaders project setting). Note that this project setting is relevant only for translated shaders from Hypershade networks. It has no effect on RenderMan shader nodes or on the shader paths displayed in the Shader Selector.
- Shadow Maps
- Shadow Maps will be automatically generated only in the following cases:
- A light source has no light attribute node attached to it; its "Use Depth Map Shadows" attribute is turned on, and the render pass node used for rendering has its "Render Shadow Maps" attribute turned on.
- A light source has a light attribute node attached to it. This light attribute node has its "Generate Shadow Maps" attribute turned on, but nothing is specified in the "Shadow Map Name" attribute. The render pass node used for rendering has its "Render Shadow Maps" attribute turned on.
- 3Delight Templates
- This project setting specifies the folder where render pass templates will be saved. 3Delight for Maya will also look up this directory and list the render pass templates it contains in the Add Render Pass menu. If the _3DFM_TEMPLATES_PATH environment variable is defined, its value will be used (and thus will override the directory specified in the 3Delight Templates project setting). Note that template files are created on-demand only and are not affected by the _3DFM_OUTPUT_PATH environment variable. See Managing Render Passes.
- 3Delight Textures
- Any node in an Hypershade network that uses a texture file name not ending with the `.tdl' extension will undergo a texture conversion process in order to speed up texture lookup during rendering. This conversion produces a 3Delight texture file that is stored under the directory specified in the 3Delight Textures project setting. If the _3DFM_TEXTURES_PATH environment variable is defined, its value will be used (and thus will override the directory specified in the 3Delight Textures project setting). It is possible to prepare texture files in order to avoid this conversion as explained in Textures In The Hypershade.
5.5.6 Hypershade translation quirks
3Delight for Maya automatically translates most hypershade networks into equivalent RenderMan shading language. However, some nodes require special attention for various reasons.
- ` bump2d'
- To use the
Tangent Space NormalsandObject Space Normalsmodes, some extra setup is required. Create a vector attribute namedbumpNormalon the node and connect the bump texture's output color to it. A connection of the texture's alpha to thebumpValueinput like Maya is using is not required but will not hurt either. - ` bump2d'
- When using with a bump map, it is best if the map's average value is near 0 or some artifacts are likely to appear in areas of high curvature. As bump maps will typically average to grey, this can be achieved by setting the file node's alpha or color offset to -0.5.
3Delight for Maya 6.0. Copyright 2000-2011 The 3Delight Team. All Rights Reserved.