Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ set_rad_sca(3G) — PersonalVisualizer 2.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

light_attenuation(3G)

set_rad_ambient_mode(3G)

set_rad_scale(3G)

NAME

set_rad_scale, inq_rad_scale − set/inquire parameters for scaling radiosity image intensities to display intensities

SYNOPSIS

C Syntax:

void set_rad_scale(fildes,scene_id,mode,gamma,ref_intensity);
int fildes,scene_id,mode;
float gamma,ref_intensity;

void inq_rad_scale(fildes,scene_id,mode,gamma,ref_intensity);
int fildes,scene_id,*mode;
float *gamma,*ref_intensity;

FORTRAN77 Syntax:

subroutine set_rad_scale(fildes,scene_id,mode,gamma,
ref_intensity)
integer*4 fildes,scene_id,mode
real gamma,ref_intensity

subroutine inq_rad_scale(fildes,scene_id,mode,gamma,
ref_intensity)
integer*4 fildes,scene_id,mode
real gamma,ref_intensity

Pascal Syntax:

procedure set_rad_scale(fildes,scene_id,mode:integer;gamma,
ref_intensity:real);

procedure inq_rad_scale(fildes,scene_id,var mode:integer;
var gamma,ref_intensity: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

mode Controls selection of the scene reference intensity.  May be either MAX_NON_LIGHT_INTENSITY or REF_INTENSITY. 

gamma Controls the shape of the scaling curve. 

ref_intensity If mode is REF_INTENSITY, then the image is scaled so that scene intensities of ref_intensity or higher are displayed with a screen screen intensity of 1.0 (maximum screen brightness).  If mode is not REF_INTENSITY, this parameter is ignored. 

Discussion

The radiosity method can produce renderings in which the range of light intensities or brightnesses far exceeds that which can be displayed.  In order to display such images, the scale of intensities in the scene must be mapped to the screen’s intensity scale.  set_rad_scale allows the user to control how this “scene to screen” scaling is done. 

To establish the scaling, a scene intensity of 0.0 is mapped to a screen intensity of 0.0, and a selected reference intensity from the scene is mapped to a screen intensity of 1.0.  A scaling curve passing through these two points then determines where any given scene intensity falls on the display’s intensity scale. 

Mode is used to determine the scene intensity that will map to the brightest screen intensity and thus define the brightest part of the image.  Mode may have one of two values. 

When mode is MAX_NON_LIGHT_INTENSITY, the intensity of the brightest object in the scene that is not a light source is mapped to a screen intensity of 1.0.  All scene intensities that are less than the maximum non-light intensity will be scaled so that they are displayed with screen intensities ranging from 0.0 up to 1.0.  Scene intensities greater than the reference intensity (usually light sources), will be displayed at a screen intensity 1.0 regardless of their actual scene intensity.  MAX_NON_LIGHT_INTENSITY allows you to prevent the light sources in the environment from dominating the brightness scale of the image and use the full screen intensity scale to display illuminated objects. 

When mode is REF_INTENSITY, the scene reference intensity is set to the value given by ref_intensity.  This user defined intensity is mapped to a screen intensity of 1.0, and all scene intensities less than ref_intensity are mapped to screen intensities between 0.0 and 1.0 as dictated by the scaling curve.  Scene intensities greater than the reference intensity will be displayed at a screen intensity of 1.0.  Hue is always preserved. 

The shape of the scaling curve that passes through 0.0 and the reference intensity is determined by the value of gamma.  Another way to control the relationship between scene and screen intensities is to change the shape of the scaling curve with the function gamma.  The scaling curve is defined by:

 

screen intensity = (scene intensity/ref_intensity)(1/gamma)

If gamma equals 1.0, the scaling curve is linear.  If gamma is greater than 1.0, darker areas of the image will be made relatively brighter.  If gamma is less than 1.0, darker areas will be made relatively darker. 

NOTES

To maintain image illumination levels that are consistent with standard Starbase rendering techniques, the default values for mode, gamma, and ref_intensity should be used for models in which point light sources provide the only illumination.  If area lights provide the sole illumination, mode should be set to MAX_NON_LIGHT_INTENSITY and gamma should be increased to about 2.2.  If both point lights and area lights illuminate the model, best results can be obtained by attenuating the point lights to match the attenuation of the area lights and then scaling the scene as if only area lights were present.  Note that the state of set_rad_ambient_mode at compute time can also significantly affect the overall illumination levels in the radiosity image. 

When texture mapping is incorporated into radiosity renderings, the colors of the texture, because they are determined exclusively by the display hardware, will not scale the same way as colors of untextured surfaces.  To ensure that textured surfaces are handled consistently with non-textured surfaces, the texture color should be “normalized” so that the brightest colors of the texture itself are scaled to 1.0 (or 255 integer).  Then the fill color of the textured surface can be used to control the brightness and/or color.  For example, to achieve a deep red textured surface, set the texture color to (1.0, 0.0, 0.0) and the surface fill color to (0.5, 0.0, 0.0). 

This command cannot be stored in a segment. 

ERRORS

invalid file descriptor. 
invalid scene_id. 
invalid mode. 
gamma <= 0.0. 
ref_intensity <= 0.0. 

DEFAULTS

mode: REFERENCE_INTENSITY. 
gamma: 1.0. 
ref_intensity: 1.0. 

SEE ALSO

light_attenuation(3G), set_rad_ambient_mode(3G). 

  —  July 12, 1991

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