[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 Attributes

Attributes are components of the graphic state that are associated with elements of the scene, such as geometric primitives and light sources. As with options, there are two kinds of attributes: the standard and the implementation specific. Standard attributes, along with their default values, are listed in the table below. Implementation specific attributes are passed through the Attribute command. All attributes are saved at AttributeBegin and restored at AttributeEnd.

Attribute Name Default values Comments
Color [1 1 1] White;
Opacity [1 1 1] Opaque;
TextureCoordinates [0 0 1 0 0 1 1 1] Only applies to paramtric surfaces such as Patch and NuPatch;
Surface `defaultsurface' A surface shader that does not need a lightsource to produce visible results;
Atmosphere -- --
Displacement -- --
LightSource -- --
ShadingRate 1 Approximatly one shading computation at every pixel;
GeometricApproximation "motionfactor" 1 ShadingRate is highered by one for each 16 pixels of motion, this also affects depth of field;
Matte 0 --
Sides 2 Objects visible from both sides;
Orientation "outside" Do not inverse transform handedness;
TrimCurve -- No trim curves defined.

Standard attributes and their default values.

3Delight has a set of implementation specific attributes, they are listed below in their respective category.

Primitives Identifiaction

Attribute "identifier" "name" "none"
Subsequent objects will be named using the string given by this attribute. This is useful when 3Delight reports warning or errors about some primitive.

Primitives Visiblity and Ray Tracing

Attribute "visibility" "integer camera" [1]
Attribute "visibility" "integer trace" [0] (12)
Attribute "visibility" "string transmission" ["transparent"] (13)
Specifies to wich specific ray an object is visible. For `transmission' rays, controls how a specific surface cast shadows on other surfaces. Possible values for this attribute are:

"transparent"
The object will not cast shadows on any other object since it is completly transparent;
"opaque"
The object will cast a shadow as if it was a completely opaque object;
"Os"
The object will cast shadow according to the opacity value given by the Opacity attribute;
"shader"
The object will cast shadows according to the opacity value computed by the surface shader.

Attribute "trace" "float bias" [.01]
This bias affects all traced rays. The bias specifies an offset added to ray's starting point (in ray's direction) so to avoid intersection with the emitting surface.
Attribute "light" "string shadows" ["off"]
Turns automatic shadow calculation ["on"] or ["off"] for LightSources specified after this directive.

Global Illumination

Attribute "irradiance" "nsamples" [64]
Specifies the default number of samples to use when calling occlusion() or indirectdiffuse() shadeops. This default value can be overriden by passing a parameter to those shadeops. See section 4.5.4 Lighting and Ray Tracing.
Attribute "irradiance" "shadingrate" [1]
3Delight can use a different shading rate for irradiance computations to speed up occlusion() and indirectdiffuse() computations. Using higher shading rates will enable irradiance interpolation across shaded grids which will speed up rendering;
Attribute "irradiance" "maxerror" [1]
Controls a maximum tolerable error when using interpolation (for irradiance shading rate higher than 1). Parameter range is [0..1].

Displacement

Attribute "displacementbound" "float sphere" [radius] "string coordinatesystem" "ss-name"
Attribute "displacementbound" "float sphere" [radius] "matrix transform" [matrix]
Attribute "bound" "float displacements" [radius]
Whenever a displacement shader is applied to a primitive, one must specify a displacement bound to inform the renderer about maximum displacement amplitude. There are three ways to specify a displacement bound: the first way is to tell the renderer that a displaced point will not move outside a sphere of a given radius, in a given coordinate system. The second way, very similar to the first one, uses a matrix instead of a name to describe the space. The third way, provided for backward compatibility only, specifies a sphere of a given radius living in the camera coordinate system.
Attribute "trace" "int displacements" [0](14)
If true, objects will be displaced prior to ray/primitive intersection tests. If false, displaced object will only be bump-mapped when viewied from traced rays. Turning on this option may degrade performance (in terms of memory usage and speed).

Other Attributes

Attribute "trimcurve" "string sense" ["inside"]
Specifies wether the "interior" or the "exterior" of a trim curve should be trimmed (cut) on a NURB surface. The default value is "inside". Specifying "outside" will reverse the behaviour.
Attribute "dice" "rasterorient" [1]
When raster oriented dicing is off ([0]), surfaces are diced in camera space instead of being adaptivly diced to meet a certain shading rate when rasterized(15). The default is on.

Attribute Default value Comment
"identifier" "name" "" Primitives are not named by default;
"visibility" "camera" [1] Everything is visible to the camera by default;
"visibility" "trace" [0] Invisible to trace();
"visibility" "transmission" "transparent" Invisible to shadow(), transmission() and occlusion();
"trace" "bias" [0.01] --
"trace" "displacements" [0] No true dispalements when tracing rays;
"irradiance" "shadingrate" [1] indirect() and occlusion() evaluation occurs at every shading sample;
"irradiance" "maxerror" [0] Interpolation disabled;
"displacementbound" -- No displacement bound by default. Do not forget to specify one when using Displacement;
"light" "shadows" ["off"] --
"limits" "eyesplits" [6] Large values can lead to long render times;
"trimcurve" "sense" ["inside"] By default, trim curves cut holes in surfaces. Specifying `outside' reverses the behaviour (trim curves cut what is outside the curve);
"dice" "rasterorient" [1] --

Implementation specific attributes and their default values

Here is a few examples showing how to set some attributes:

  1. Primitives visible from camera and shadow rays (as opaque objects) but not reflection/refraction rays
     
    Attribute "visibility" "camera" [1]
    Attribute "visibility" "transmission" ["opaque"]
    Attribute "visibility" "trace" [0]
    
    or in a more compact way,
     
    Attribute "visibility" "camera" 1 "transmission" ["opaque"] "trace" 0
    
  2. Specify a displacement bound of 0.1 in object space
     
    Attribute "displacementbound" "sphere" [0.1]
              "coordinatesystem" ["object"]
    


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Aghiles Kheffache on July, 31 2003 using texi2html
3Delight 1.0.0. Copyright 2000-2003 The 3Delight Team. All Rights Reserved.