Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ inq_surf_sh(3G) — PersonalVisualizer 2.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Curve_resolution(3G)

surf_shading_resolution(3G)

NAME

surf_shading_resolution, inq_surf_shading_resolution − set/inquire shading resolution for radiosity rendering

SYNOPSIS

C Syntax:

void surf_shading_resolution(fildes,type,resolution);
int fildes,type;
float resolution;

void inq_surf_shading_resolution(fildes,type,resolution);
int fildes,*type;
float *resolution;

FORTRAN77 Syntax:

subroutine surf_shading_resolution(fildes,type,resolution)
integer*4 fildes,type
real resolution

subroutine inq_surf_shading_resolution(fildes,type,resolution)
integer*4 fildes,type
real resolution

Pascal Syntax:

procedure surf_shading_resolution(fildes,type:integer;
resolution:real);

procedure inq_surf_shading_resolution(fildes:integer;
var type:integer;var resolution: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

type Determines how radiosity shading resolution is specified for polygonal surfaces.  Values are ABSOLUTE_RES or NO_RES. 

resolution Specifies an approximate distance, in world coordinates, between the surface points where radiosity shading is computed. 

Discussion

surf_shading_resolution controls, and inq_surf_shading_resolution inquires the distribution of the surface points at which illumination values are computed during radiosity rendering. 

Standard Starbase rendering computes shading for polygonal surfaces only at the polygon vertices.  In many cases, this provides a sufficient level of realism, but in areas where spotlights, shadows, or other effects cause rapid changes in shading across a relatively small surface area, illumination values must also be calculated at points interior to the surface in order to obtain an accurate rendering.  The radiosity renderer generates interior points by “slicing and dicing” original polygons into smaller polygons.  surf_shading_resolution controls the degree of subdivision that occurs and thus the accuracy with which shadows and spotlight effects can be captured. 

The type and resolution parameters are used to set subdivision as follows:

When type is ABSOLUTE_RES, interior points will be generated approximately resolution units apart in world coordinates.  If resolution is set to 0.0, subdivision is disabled and shading is computed at polygon vertices. 

When type is NO_RES, radiosity shading is computed only at the original polygon vertices.  In this case, the resolution parameter is ignored. 

surf_shading_resolution only affects subsequently encountered polygons and may be called as often as necessary during a segment to selectively set the shading resolution.  If the illumination across a particular polygon is expected to vary a great deal (if a shadow edge falls across the polygon, for example), then a finer shading resolution should be set for that polygon.  If the lighting on a surface is not expected to vary much, as is generally the case with small polygons, the type parameter can be reset to cause no subdivision. 

surf_shading_resolution affects all of the following polygonal primitives:

polygon3d       arc
partial_polygon3d       partial_arc
polygon2d       ellipse
partial_polygon2d       partial_ellipse
rectangle

Spline surfaces and spline primitives are not affected by this command.  Radiosity calculations for these objects are performed at the vertices of the polygons into which the spline surface is subdivided according to the Starbase curve_resolution command.  Quadrilateral mesh and triangular strip primitives are also unaffected by this command.  Radiosity shading is computed only at the original vertices of the mesh or strip. 

NOTES

The shading resolution should be set carefully.  Too low a resolution will produce unrealistic images.  Too high a resolution will unnecessarily increase the radiosity calculation time. 

surf_shading_resolution only affects the computation of radiosity renderings.  Ray traced renderings are not affected by this command, nor are any of the standard Starbase lighting models. 

LIMITATIONS

Most polygons and partial polygons can be successfully subdivided.  In some cases, however, polygon subdivision may not be able to be completed.  These cases are:

1.  Polygons and/or partial polygons that contain edge crossings.  To allow for numerical imprecision, however, edges that touch or cross within a small tolerance are acceptable. 

2.  Extremely unflat polygons. 

3.  Polygons and partial polygons that are not coplanar. 

In such cases, radiosity calculations are performed at the original polygon vertices and at any interior points that were successfully generated. 

ERRORS

Invalid file descriptor. 
Invalid type. 
resolution less than or equal to 0.0 when type = ABSOLUTE_RES.  resolution is meaningless when type = NO_RES. 

DEFAULTS

type =  NO_RES. 
resolution = 0.0. 

SEE ALSO

Curve_resolution(3G). 

  —  July 12, 1991

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