File: Shading.mesa
Last edited by Bier on May 23, 1985 11:00:35 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: A camera model for shading surfaces, given surface type, lighting conditions and aperture size. No attempt is made to provide finite depth of field or other artifacts of a real camera.
Frank Crow added Utah-style highlights on September 23, 1982 12:22 pm
DIRECTORY
GraphicsColor,
Rope,
SV3d,
SVModelTypes,
SVVector3d;
Shading: DEFINITIONS =
BEGIN
Given a surface normal and the vector to the light source (we assume the light source is far compared to the diameter of a sphere containing the whole scene, so that this light source vector can be considered a constant), and given a surface type and light source type, we can find the radiance of the surface (R in watts/meter^2). Then, given the aperture size and the distance of the object from the aperture, we can find the solid angle of the aperture (OmegaAperture in steradians = (area of aperture)/(radius^2)). If we assume that the viewer is far from the scene compared to the diameter of a sphere containing the scene so radius is roughly constant over the scene then OmegaAperture depends only on the area of the aperture (meters^2). We are interested in the Irradiance (E) of our "film" (The screen or printer). This is just E = R*OmegaAperture (watts/meter^2).
To complete the cameral model, we would need to consider exposure time and film sensitivity, but, I will pretend that the film is a screen which sends to the viewer all of the power it receives.
A further discussion of rediometric terms appears in my paper (An Image Understanding Primer, MIT 1982) pp. 21 - 23, or see Horn, Berthold K. P. and Sjoberg, Robert W.. "Calculating the Reflectance Map," AIMemo 498, MIT AI Lab, October 1978.
Color: TYPE = GraphicsColor.Color;
LightSource: TYPE = SVModelTypes.LightSource;
LightSourceList: TYPE = SVModelTypes.LightSourceList;
Vector: TYPE = SVVector3d.Vector;
Point3d: TYPE = SV3d.Point3d;
CollimatedLambertianRadiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL ← 1] RETURNS [radiance: REAL];
Collimated light source at lightSource. Lambertian surface with given albedo (0 to 1) oriented by given surfaceNormal.
DiffuseReflectance: PUBLIC PROCEDURE [surfaceNormal: Vector, surfacePt: Point3d, surfaceColor: Color, lightSources: LightSourceList] RETURNS [completeColor: Color];
DiffuseAndSpecularReflectance: PROCEDURE [eyePoint: Point3d, surfaceNormal: Vector, surfacePt: Point3d, surfaceColor: Color, lightSources: LightSourceList] RETURNS [color: Color];
Frank Crow's highlighted intensity model
CollimatedSpecularRadiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL ← 1] RETURNS [radiance: REAL];
Collimated light source at lightSource. Specular surface with given albedo oriented by given surfaceNormal.
SimpleFilmIrradiance: PROCEDURE [radiance: REAL, omegaAperture: REAL] RETURNS [irradiance: REAL];
SolidAngle: PROCEDURE [surfacePoint: Point3d, areaAperture: REAL] RETURNS [omegaAperture: REAL];
Assumes aperture at [0,0,0];
LamFilmIrradiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL ← 1, omegaAperture: REAL] RETURNS [irradiance: REAL];
A convenience routine which combines CollimatedLambertianRadiance and SiMpleFilmIrradiance.
SpecFilmIrradiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL ← 1, omegaAperture: REAL] RETURNS [irradiance: REAL];
A convenience routine which combines CollimatedSpecularRadiance and SimpleFilmIrradiance.
END.