Wednesday, July 16, 2008

MOSAIC feature ramblings - part 8

Part 8 - The Groups Setup tab:


Groups SetupThe "Groups Setup" tab allows you to use code fragments and atmosphere shaders with groups of objects instead of just one at a time. This can prove especially helpful when dealing with large and complex scenes with lots of custom fragment work. The exporter achieves groups in RenderMan by wrapping every object in a group in a single AttributeBegin/End block, allowing custom code to be entered at the beginning or end of the block. This ensures that any custom code entered in the block is pushed and popped off the render state so they will not affect anything else outside of the group.

The exporter handles objects in groups in a very simplistic manner, it cycles through each group exporting each object in the group only once. This means that multiple or nested group setups are ignored and each object is only used in the first group it belongs to.

Also note that lamps must be declared before all geometry (unless dealing with area light geometry), so lamps will not be apart of any groups (however lights can still be put in groups for the material GR: control).

The group selection menu will only recognize groups that have something in them (empty groups are ignored), and groups cannot use RIBsets (due to some internal complexities). The "Group Block" archive menu has options unique only to groups. By default this option is set to "Ignore Group" for all new groups and must be set to "Attribute Block" before the group will be exported (although the objects in the group will still export but not as apart of a group).

Let's illustrate a simple example of using groups for scene setup. Let's say you're browsing the 3Delight docs and see a SSS example you want to try.

The example shows some RIB source using an attribute like this:

Attribute "subsurface" "scattering" [ 2.19 2.62 3.00 ] "absorption" [ 0.0021 0.0041 0.0071 ] "refractionindex" 1.5 "shadingrate" 16 "scale" 0.2

You read that this attribute simply needs to be placed before any geometry you want to use SSS. To do this in MOSAIC you would simply create a new text file and name it something like "cf_sss" and copy the code in it, then select it in the "Object Begin Code" menu in the "Geometry Setup" tab for the object you want to use SSS, simple! Now let's say you like the effect but want to experiment with 30 objects switching SSS on and off them individually, but you don't want to have to turn "cf_sss" code fragment on and off each one individually. This is where groups come in. You can assign the objects to a group and then attach the "cf_sss" to that group's "Group Begin Code", using Blender to add and remove objects from group without ever having to touch MOSAIC making experimenting much faster :)

Now let's outline the controls for this tab:

Navigation management:

Here's a breakdown of the controls in this group:

  • Select Group -This will show a list of available groups for selection, once selected all controls in this tab will update.

Code management:
This group of controls is for attaching user created code fragments (text file with the "cf_" prefix in their names) to the beginning and end of different RIB blocks. As with the previous group, this group of settings is available in various configurations for all the remaining tabs.

Here's a breakdown of the controls in this group:

  • Group Block - This menu allows you to specify whether to export the RIB code into an attribute block or completely ignore the group.

  • Group Begin Code - This allows the insertion of custom code fragments into the beginning of the group attribute block before anything MOSAIC exports.

  • Group End Code - This allows the insertion of custom code fragments into the end of the group attribute block after anything MOSAIC exports.

Shader management:
This group of settings is available in various configurations for all the remaining tabs and is for selecting shaders for the selection.

Here's a breakdown of the controls in this group:

  • Atmosphere Shader - This will select an atmosphere (fog) shader that will only affect the objects in this group.

  • Notes - This will display a popup of any notes attached to shader fragment by the author (usually containing information about which Blender controls are used by this shader).


Well, that's it for the groups tab... next up is the "Geometry Setup" tab :)

Thanks for reading, WHiTeRaBBiT

No comments:

Post a Comment