Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The renderer uses the RixProjectionFactory object by invoking RixBxdfFactory::CreateProjection()  to obtain a  RixProjection. A description of various options associated with the current render are provided to the factory via the RixProjectionEnvironment &env. This class includes information about the current format (the width and height of the image in pixels and the pixel aspect ratio), the screen window, the shutter time values, and the near and far clipping planes, and the world to camera transform. Developers are expected to use this information, along with the arguments supplied to the plugin via the RixParameterList pList, to create an instance of RixProjection that encapsulates the information necessary to model the desired camera and lens behavior.

RixProjectionEnvironment contains one field that can be altered: the deepMetric field. This is used to indicate to the renderer the depth metric used for computing Z values when rendering deep output. The default value of k_cameraZ indicates the renderer should use the distance strictly in the Z axis, while k_rayLength indicates that the distance should be measured along the ray direction. All other fields on RixProjectionEnvironment should be considered read only.

RixProjection

Once a RixProjection object is obtained, the renderer will invoke the following methods:

  • RixSCDetail RixBxdf::GetProperty(ProjectionProperty property, void const** result)

    Projection plugins will be queried via this method at the beginning of rendering for properties that are of interest to the renderer. The value of the property is passed back to the renderer via the result parameter. These properties are invariant during the frame (i.e. they are options). The current list of properties include:

    • k_DicingHint: The plugin should return an enum DicingHint indicating the general strategy the renderer should use to dice geometry. DicingHint takes one of three values: k_Orthographic, k_Perspective, and k_Spherical, and should take the value of be set to the type of camera projection that is closest to the one being implemented in the projection plugin. Not setting this property correctly means the renderer may underdice or override geometry in the scene, which may impair performance or lead to visual artifacts.
    • k_FieldOfView: In conjunction with k_DicingHint returning a value of k_Perspective or k_Spherical, the plugin should return a floating point value indicating the field of view of the projection in degrees. This value is used as a hint to the renderer for dicing geometry purposes. Note that the projection plugin itself is still responsible for actually implementing a camera model that takes into account this field of view.
    • k_FStop, k_FocalLength, k_FocalDistance: The plugin describes the desired depth of field (defocus) settings to the renderer. All three properties are floats. If the projection plugin returns values for these properties, the renderer will use them as part of the computation for the initial aperture samples supplied to the projection plugin.

    As all of these properties are invariant during the frame, Projection plugins should return k_RixSCUniform for any aupported properties, otherwise they should return k_RixSCInvalidDetail.

...