Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ inq_surf_gl(3G) — PersonalVisualizer 2.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

set_ray_tree_parms(3G)

surface_model(3G)

surf_global_model(3G)

NAME

surf_global_model, inq_surf_global_model, − set/inquire surface reflectance, transmittance, and refraction parameters applied to ray traced objects

SYNOPSIS

C Syntax:

void surf_global_model(fildes,reflectance,transmittance,
index_of_refr);
int fildes;
float reflectance,transmittance,index_of_refr;

void inq_surf_global_model(fildes,reflectance,transmittance,
index_of_refr;
int fildes;
float *reflectance,*transmittance,*index_of_refr;

FORTRAN77 Syntax:

subroutine surf_global_model(fildes,reflectance,
transmittance,index_of_refr)
integer*4 fildes
real reflectance,transmittance,index_of_refr

subroutine inq_surf_global_model(fildes,reflectance,
transmittance,index_of_refr)
integer*4 fildes
real reflectance,transmittance,index_of_refr

Pascal Syntax:

procedure surf_global_model(fildes:integer;reflectance,
transmittance,index_of_refr:real);

procedure inq_surf_global_model(fildes:integer;
var reflectance,transmittance,index_of_refr:real);

DESCRIPTION

Input Parameters

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

Input/Output Parameters

reflectance Reflection coefficient in the range of 0.0 to 1.0. 

transmittance Transmittance coefficient in the range of 0.0 to 1.0. 

index_of_refr
Index of refraction; greater than 0.0.

Discussion

surf_global_model specifies reflectance, transmittance, and refraction surface properties that are applied to ray traced objects. 

The reflectance coefficient determines how much of the light intensity from the mirror direction will reflect from the surface to contribute to the total intensity.  A reflectance of 1.0 simulates a perfect mirror, while  a value of 0.0 stipulates no contribution from the mirror direction, so no reflection rays are generated.  The mirror direction is determined by the relationship between the eye direction and the surface. 

The transmittance coefficient determines the relative transparency of an object.  A transmittance of 1.0 simulates perfectly clear glass, while a value of 0.0 defines the object as opaque.  The diffuse color of the object filters all light striking the object.  The diffuse and ambient contribution of a transparent object will normally be attenuated by 1.0 minus the transmittance; the exception to this is when a ray hits a transparent object and does not spawn a transmittance ray In this case the object is treated as if it is opaque, with the diffuse contribution being unattenuated. 

The index_of_refr determines how a transparent surface bends or refracts light rays that pass through it.  Useful values for the index_of_refr range from 1.0 (no refraction), to about 2.0 (the maximum level of refraction found in nature).  Glass, for example, has an index_of_refr of about 1.5.  Refraction values of less than 1.0 are usually only applicable if the eye position is inside an object (under water, for example), and the view is toward the open air.  The orientation of the surface with respect to the light source affects the direction of the bending that takes place. 

When rendering an object, the ray tracer gets the ambient term, the diffuse reflection coefficient, the specular reflection coefficient, and the specular highlighting power as set by surface_model.  The following computations are then performed to complete the surface model for ray tracing:

The energy due to mirror reflection in the eye direction:

Er = (Ms)(Is)(Cs)

The energy due to transmittance in the refraction direction:

Et = (Kt)(It)(Cd)

The total energy is:

E = (Ea+Ed)(1−Kt)+Es+Er+Et

Where:

Ms        = Mirror reflectance coefficient of the surface (reflectance)
Is        = Illumination from mirror direction
Cd        = Diffuse color of the surface (RGB as set by fill_color)
Cs        = Highlight color of the surface (RGB as set by surface_model)
Kt        = Transmittance coefficient of the surface (transmittance)
It        = Illumination from refraction direction
Ea        = Energy due to the ambient contribution
Ed        = Energy due to the diffuse contribution
Es        = Energy due to the specular highlight contribution

NOTES

The parameters set by surf_global_model only affect ray traced renderings of the specified polygons.  Neither the radiosity nor the Starbase lighting models are affected by these parameters. 

The Starbase surface_coefficients command does not affect surface reflectance or transmittance. 

ERRORS

Invalid file descriptor. 
reflectance is not in the range from 0.0 to 1.0. 
transmittance is not in the range from 0.0 to 1.0. 
ind_of_refr is less than or equal to 0.0. 

DEFAULTS

reflectance=0.0: no reflection rays are generated.
transmittance=0.0: all objects are opaque.

SEE ALSO

set_ray_tree_parms(3G), surface_model(3G), Starbase Graphics Techniques.

  —  July 12, 1991

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