Short Contents

7.9 Display Subsets

3Delight can renderer an arbitrary number of the so called "secondary displays". Each secondary display can be fed with certain variables from shaders attached to the geometry. This is handy to output many different variables for later compositing or number crunching. But what if one wants to have different geometry, not only output variables, in each display? This functionality is achieved using the grouping membership attribute and the special `string subset' parameter that is accepted by RiDisplay. The operation is summerized in two steps:

  1. Put geometry in groups that reflect the wanted separation. This can be done using:
    Attribute "grouping" "membership" ["groupname"]
    
    This attribute is further described in Primitives Identification.
  2. To render a particular group in a particular display, use the `subset' special parameters:
    Display "layer.tif" "tiff" "rgb" "string subset" ["groupname"]
    
    Note that it is exactly the same attribute as used for trace group memberships, as explained in Trace Group Membership. One can combine many groups together, as in,
    Display "layer.tif" "tiff" "rgb" "string subset" ["group1,group2"]
    
    Or exclude particular groups, as in,
    Display "layer.tif" "tiff" "rgb" "string subset" ["-group3"]
    

The display subset feature would be incomplete if it was not possible to have a different alpha channel for each display: when rendering a foreground and a background one expects to be able to composite the two layers together. This is achieved by adding the alpha channel to the display:

Display "foreground.tif" "tiff" "rgba" "string subset" ["foreground"]
Display "foreground_ambient.tif" "tiff" "color ambient,alpha"
	"string subset" ["foreground"]

3Delight 10.0. Copyright 2000-2011 The 3Delight Team. All Rights Reserved.