4.2 RIB Archives Guidelines
| 4.2.1 Writing a RIB Archive using a Render Pass | ||
| 4.2.2 Reading a RIB Archive | ||
| 4.2.3 Rendering while Archiving Scene Elements | ||
| 4.2.4 Miscellaneous RIB Archives tips |
4.2.1 Writing a RIB Archive using a Render Pass
A RIB Archive is a RIB file that is not designed to be rendered by itself but to be included in another RIB file. This way, it is possible for instance to share objects between frame RIBs, saving disk space and RIB generation time.
A simple way to create a RIB Archive in 3Delight for Maya consists of the following steps:
- Create a subset of the scene elements that will be archived. This can be done in various ways, such as putting these elements in a separate Maya render layer, or more simply, by creating a Maya set that contains the elements to be archived.
- Create a render pass. While this is purely optional, it is usually convenient to rename the node to avoid confusion later with other render passes that will be used for image rendering.
- Set the Render Mode of the render pass (in the Output panel) to `RIB Archive'.
- Set the RIB Filename attribute to the archive file name to be created. When archiving animated objects, consider using `#' or `@' to insert the current frame number in your filename. There are more sophisticated tokens also available to specify frame number; see File Path Expressions for details.
- In the Render Sets panel, select the scene subset created at the first step. If a Maya set was created and it contains objects and lights, remember to select the set in both Objects to Render and Lights to Render.
- Render..
NOTEThere are several advanced options in the RIB Archives panel that you might want to consider. Refer to RIB Archives for more information.
4.2.2 Reading a RIB Archive
Existing RIB Archive files can be read back into a scene using a RIB archive node. Once the archive file is specified, 3Delight for Maya will look at its first few lines for a line specifying the archive bounding box. The format of the line is the following:
# Bounds minX maxX minY maxY minZ maxZ
The bounding box information serves two purposes:
- The appearance of the RIB archive node in a scene view port is defined by these dimensions;
- The bounding box information is required when using a delayed archive read directive, since the renderer needs to know in what part of the space the reading will be necessary.
If the archive file does not provide the bounding box info, it is possible to enter a bounding box manually, or simply dismiss it and avoid using the delayed archive reading directive.
Here is a example showing how it is possible to read an archive in a scene:
- Create a RIB archive node using the Add RIB Archive item in the 3Delight menu.
- In the Attribute Editor, set the RIB Filename attribute to refer to the archive file.
- If the bounding box information is found in the file, the Archive Read Mode will be set to `Delayed'. This is usually desirable since the archive file will only be read when the space it occupies is visible to the camera when rendering.
- If the bounding box information is not found in the file, the Archive Read Mode will be set to `Immediate'. In this mode, the archive file is always read regardless of what is visible to the camera when rendering. It is possible to enter manually a bounding box using the Bbox Min and Bbox Max fields, and set the Archive Read Mode to `Delayed' if desired.
4.2.3 Rendering while Archiving Scene Elements
While the render pass node can create RIB archive and the RIB archive node can read them, it is possible to connect them together so that scene elements can be archived when needed and then the archive file created is used for rendering. Here is an example on how to do this:
- Create a subset of the scene elements that will be archived. This can be done in various ways, such as putting these elements in a separate Maya render layer, or more simply, by creating a Maya set that contains the elements to be archived.
- Create a RIB archive node using the Add RIB Archive item in the 3Delight menu.
- Rename this node to something more evocative of what it is going to read.
- In the Attribute Editor, click on the Texture button on the right of the Archive Pass option menu. This will create a render pass node, set its Render Mode to `RIB Archive', set its RIB Filename to a decent default value (based on the name of the RIB archive node), and connect it to this RIB archive node.
- Note that the RIB Filename attribute of the RIB archive node is now connected to the created render pass. Also note that the Archive Read Mode is automatically switched to `Delayed'. When the connected render pass will be rendered, the bounding box of the archive will be automatically set.
- Click on the AE button on the right of the Archive Pass option menu to edit the attributes of the connected render pass.
- While this is optional, it is recommended to rename this render pass to avoid confusion with other similar nodes.
- In the Render Sets panel, select the scene subset created at the first step. If a Maya set was created and it contains objects and lights, remember to select the set in both Objects to Render and Lights to Render.
- Configure the other rendering options to your liking. For instance, you might want to modify the RIB Filename (in the Output panel) , or the Archive Write Mode (in the RIB Archives panel). Refer to The Render Pass.
- Create another render pass using the Add Render Pass menu. This pass will be used to produce an image.
- Click Render. The rendering process will first render the render passes connected to any RIB archive nodes contained in the render set of the render pass whose Render button was clicked. The archives are then used it in the image rendering.
4.2.4 Miscellaneous RIB Archives tips
Here are few tips regarding the RIB archives:
- Using the RIB archive node, it is easy to add extra instances of objects while keeping the scene very light by simply duplicating the node.
- When archived objects are still present in the scene, it is possible to either ignore them completely for the rendering and only use the archive, or to keep the objects in the scene and also include the archive. The later could be used to add an extra instance of the objects in the scene, simply by moving the RIB archive node elsewhere in the space. Control of the presence of the archived objects is done via the Ignore Archived Objects attribute of the render pass used to render the image.
- If the RIB archive node might be moved to a different position from where the objects were when archived, it is important to leave the Concatenate Geo Transforms attribute to on, in the RIB Archives panel of the render pass used to create the archive. If the archive contains light sources and it is desired that these are also moved, keep the Concatenate Light Transforms set to on. Those two attributes are on by default.
- It is possible to avoid re-creating archive files; set the Archive Write Mode of the render pass nodes that creates the archive to `Reuse Existing Archive'. Or, simply have the rendering process assume that all the required files are there without checking anything by turning off the Generate RIB Archives toggle of the render pass that produces the image. Both of these options are in the RIB Archives panel, Advanced sub-panel.
- When creating the RIB archive, Hypershade shaders for the content of the archive are created when relevant. In order to keep shaders as efficient as possible, the generated code will contain statements to output only the AOVs that are selected in the render pass used for the rendering. So, if the RIB archive is going to be used in a scene that will be rendered using some of the predefined AOVs, it is required to define the same AOVs in the Secondary Displays section of the render pass used to create the archive. For instance, if a scene is going to be rendered using the `ambient' AOV and contains a RIB archive node, the archived objects will render properly in the `ambient' display only if the `ambient' AOV was defined in the render pass used to create the archive.
- It is possible to attach a geometry attribute node to a RIB archive node. If the archive was created with the Archive Geometry Attributes toggle off, then the Geometry Attribute Node attached to the RIB archive node will affect all of the content of the archive. Even when the archive was created with the Archive Geometry Attributes toggle on, it might still be useful to attach a geometry attribyte node a RIB archive node when the Archive Read Mode is set to `Delayed'. For instance, if a given RIB archive node, whose Archive Read Mode is set to `Delayed', does not set its Transmission attribute to anything, its content will not be considered for ray traced shadows. The same goes for other attributes, such as Visible To Reflections and subsurface scattering attributes.
3Delight 8.0. Copyright 2000-2008 The 3Delight Team. All Rights Reserved.