Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ set_ray_tre(3G) — PersonalVisualizer 2.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

render_scene(3G)

set_ray_tree_parms(3G)

NAME

set_ray_tree_parms, inq_ray_tree_parms − set/inquire the ray tree parameters for ray tracing

SYNOPSIS

C Syntax:

void set_ray_tree_parms(fildes,scene_id,max_depth,tree_cutoff);
int fildes,scene_id,max_depth;
float tree_cutoff;

void inq_ray_tree_parms(fildes,scene_id,max_depth,tree_cutoff);
int fildes,scene_id,*max_depth;
float *tree_cutoff;

FORTRAN77 Syntax:

subroutine set_ray_tree_parms(fildes,scene_id,max_depth,
tree_cutoff)
integer*4 fildes,scene_id,max_depth
real tree_cutoff

subroutine inq_ray_tree_parms(fildes,scene_id,max_depth,
tree_cutoff)
integer*4 fildes,scene_id,max_depth
real tree_cutoff

Pascal Syntax:

procedure set_ray_tree_parms(fildes,scene_id,max_depth:integer;
tree_cutoff:real);

procedure inq_ray_tree_parms(fildes,scene_id:integer;
var max_depth:integer;var tree_cutoff:real);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

scene_id Scene identifier; as returned by create_scene. 

Input/Output Parameters

max_depth Maximum allowable tree depth.  Must be greater than 0. 

tree_cutoff Value from 0.0 through 1.0, used to adaptively control ray tree depth.  Rays contributing less than this fraction to the final pixel value are assumed to add little to image quality, and so are not generated. 

Discussion

Ray tracing models the global illumination of an environment by tracing rays from the viewpoint through each pixel of the image.  For each ray, the object it intersects is determined.  At the intersection point, new rays can be generated.  In this way, a tree of rays through the environment is constructed.  The color of each pixel is calculated by summing the contribution of each intersection point along the tree.  Limiting the depth of the ray trees reduces the overall number of calculations that must be performed and can significantly reduce rendering time. 

Tree_cutoff and max_depth govern the allowable depth of the ray trees that will be generated when scene_id is ray traced.  At each branch, tree_cutoff is checked.  If the cutoff criteria is satisfied, then no more rays are generated for this tree.  Max_depth puts an absolute limit on the depth of the tree. 

Tree_cutoff is given a value from 0.0 to 1.0.  A ray’s contribution is computed from the reflectance and transmittance as set in surf_global_model. 

A reflection ray has a contribution of:

Cr = Pc×Ms

A refraction ray has a contribution of:

Ct = Pc×Kt

Where:

Pc        = Parent ray’s contribution (Pc=1 for eye rays)
Ms        = Mirror reflectance coefficient (reflectance set in surf_global_model)
Kt        = Transmittance coefficient (transmittance set in surf_global_model)

NOTES

Ray tracing parameters do not affect radiosity renderings of scene_id. 
This command cannot be stored in a segment.

ERRORS

Invalid file descriptor. 
Invalid scene_id. 
max_depth out of range. 
tree_cutoff out of range. 

DEFAULTS

tree_cutoff default is 0.1
max_depth is 5. 

SEE ALSO

render_scene(3G). 

  —  July 12, 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026