The operation of a RenderMan renderer is mostly controlled by the Options and Attributes mechanisms, both of which associate named values with the various stages of the rendering pipeline.
Options are associated with the scene as a whole. Once the RiWorldBegin
directive has been reached, the options are fixed, it is then illegal to call
any Ri directives that can modify the options state. Attributes are
associated with the attribute stack, and as such are assigned to light sources
and geometric primitives. The value of these attributes are pushed and popped
along with other attribute state by the RiAttributeBegin/End
directives.
Options and attributes are stored as a named set of name/value pairs. That is, each option or attribute has a unique name, and can contain any number of values, each with a unique name and type. The general format of an option or attribute directive is
Option "<option name>" "<value1 typespec>" [<value1 value(s)>] "<value2 typespec>" [<value2 value(s)>]
where typespec
is either the name of an already declared value, or an inline
declaration. For example:
Declare "string mystringvalue"
Option "myopt" "mystringvalue" ["some string"] "float myfloatvalue" [1.0]
Note from the second example above that it is perfectly reasonable to specify multiple name/value pairs in a single Option directive, each will add a new value to the same containing option or attribute.
There are a number of predefined options and attributes that Aqsis recognizes
for use internally to configure the operation of the renderer; these are listed
below. In addition, Aqsis fully supports the specification of arbitrary
user-defined name/value pairs for both options and attributes. These may be
queried from the shading language using the standard option()
and
attribute()
functions.
Aqsis locates the various external assets required during rendering via a standard Option called “searchpath”. The “searchpath” Option has a number of string values that tell Aqsis where to look for various asset types. The string value for each of these specifies a list of search paths separated by a colon (‘:’).
The special search path character “&” represents the previous value of the option. This is only available in “searchpath” options. Using this character you can append or prepend paths to the default path list, i.e.
Option "searchpath" "shader" ["/my/shaders:&"]
Each option value is described below, they are all of type “string”, and follow the same format as the example above.
RiReadArchive
directive.RiDisplay
directive, when it is looking for a
display shared object.RiSurface
.RiProcDynamicLoad
directive to locate DSO’s
for the procedural RIB plugin.The hider specifies the algorithm used to resolve surface visibility (that is, to decide which surfaces appear “on top” in the final render). Aqsis supports only one hider type, “hidden”, which uses stochastic point sampling for the visibility computation.
The “hidden” hider supports several options:
Hider "hidden" "jitter" [0]
Hider "hidden" "depthfilter" ["min"]
These values control the various settings used during rendering that have an effect on performance and memory use. They are grouped under the “limits” option.
Option "limits" "bucketsize" [16 16]
Option "limits" "bucketmodulo" [-1]
Option "limits" "eyesplits" [10]
Option "limits" "gridsize" [256]
Option "limits" "texturememory" [8192]
[1 1 1]
which means that any
partially transparent object will be omitted from shadow maps by default.Option "limits" "zthreshold" [1 1 1]
Aqsis supports shadows using depth maps, these values control various settings that affect the sampling and generation of depth maps, and their use during rendering. They are grouped under the “shadow” option.
Option "shadow" "bias" [0.0]
Option "shadow" "bias0" [0.01]
Option "shadow" "bias1" [0.05]
Certain features in the Aqsis rendering pipeline can be controlled and/or enabled depending on the content being rendered. These values allow the user to control the renderer at a general level. They are grouped under the “render” option.
Option "render" "bucketorder" ["horizontal"]
Option "render" "multipass" [0]
These values associate information with the primitives they apply to, that allow
various processes to identify the primitive. This information is used internally
to provide meaningful feedback during rendering, and can be accessed by shaders
using the attribute
RSL command. They are grouped under the “identifier”
attribute.
Attribute "identifier" "name" [""]
These values control how Aqsis compensates for changes in a primitives surface due to displacement shading. They are grouped under the “displacementbound” attribute.
Attribute "displacementbound" "sphere" [0.0]
Attribute "displacementbound" "coordinatesystem" ["object"]
Certain primitive types in Aqsis can have trimcurves, that is a 2D curve in parameter space that removes a certain portion of the surface, commonly used with NURBS surfaces. These values allow the user to control how those trim curves are applied. They only apply to surfaces for which trim curves are applicable. They are grouped under the “trimcurve” attribute.
Attribute "trimcurve" "sense" ["inside"]
When Aqsis processes primitives, it has, at various times, to make a decision regarding whether to dice or split, and if dicing, how finely to dice. These values allow the user to influence those decisions to achieve a specific effect. They are grouped under the “dice” attribute.
Attribute "dice" "binary" [0]
The “aqsis” attribute is used for enabling internal hacks.
Attribute "aqsis" "expandgrids" [0.01]
When used with the “multipass” render option, these attributes control the generation of automatic shadow depth maps by Aqsis.
Attribute "autoshadows" "res" [300]
Attribute "autoshadows" "shadowmapname" [""]
RiMatte
is typically used to allow portions of an image to be replaced in
compositing with live action shots or backgrounds (“matte paintings”) etc. For
this kind of thing we’d also like to render shadows cast by CG objects so that
they form dark opaque areas which can be composited over the live action.
Unfortunately this isn’t possible in a single pass when using the matte objects
defined in the standard, since the colour and opacity of the matte are
interpreted in an unusual way.
Aqsis adds an additional setting to the RiMatte()
interface call,
RI_MATTEALPHA
to support this kind of usage. Mattes with Alpha are a
new kind of Matte object which are always opaque from the point of view of the
hider but retain both opacity (“alpha”) and colour information from shaders
attached to them. That is, an alpha matte fully occludes all objects behind it
in the scene but the user can at the same time specify a nonzero alpha value and
colour which make their way unmodified into the output image.
This special attribute is specified via the RiMatte command:
The GeometricApproximation
attribute allows some control over the accuracy
with which the renderer tesselates geometry into micropolygons for renderering.
Normally, the micropolygon area is constrained to be smaller than the
ShadingRate
attribute. However, when a surface is highly blurred - either
by motion blur or depth of field effects - it is desirable to increase the
shading rate for efficiency. This has the effect of coarsening the
tessellation, but this often doesn’t matter since the details are lost to
blurring in any case.
Defaults for the various types of geometric approximation have been chosen with the intention of preserving image quality compared to images rendered with the approximations turned off.
GeometricApproximation "focusfactor" 1.0
is the default.GeometricApproximation "motionfactor" 0.0
turns the
motionfactor approximation off.Aqsis provides a very flexible and powerful mechanism to override or add to
options in the [[doc:rib|RIB]] file being rendered. The -option command
line argument allows you to insert arbitrary options - and in fact, arbitrary
RIB fragments - into the command stream just prior to the RiWorldBegin
request. You can provide multiple fragments via multiple -option
arguments;
these will be processed immediately before RiWorldBegin
in the order that
they are specified on the command line.
A typical use for this facility is to override the display request to force output to a different file, or to output to an additional file. For example,
aqsis -option="Display \"myname.tif\" \"file\" \"rgba\"" some_file.rib
allows you to specify not only the type of display, but also the name, and even
the type of data that will be displayed. Note that you must be careful to
escape the use of double quotes on the command line so that they get
through to the renderer correctly. Using double quotes within a command line
parameter is likely to confuse the command line processor; mark them with a ‘'
to prevent them closing the double quotes surrounding the argument to
-option
.
Aqsis has some additional command line arguments which also affect the options
state of the renderer. For example, changing or adding displays may also be
done with the simple command line options -type
and -addtype
, though
these offer less flexibility than the -option
mechanism described above.