DIRECTORY Imager, Rope, SV3d, SVModelTypes, SVVector3d; SVShading: CEDAR DEFINITIONS = BEGIN Color: TYPE = Imager.Color; LightSource: TYPE = SVModelTypes.LightSource; LightSourceList: TYPE = SVModelTypes.LightSourceList; Vector3d: TYPE = SVVector3d.Vector3d; Point3d: TYPE = SV3d.Point3d; ExtractRGB: PROC [color: Color] RETURNS [r,g,b: REAL]; NormalizeRGB: PROC [r,g,b: REAL] RETURNS [color: Color]; DiffuseReflectance: PUBLIC PROCEDURE [surfaceNormal: Vector3d, surfacePt: Point3d, surfaceColor: Color, lightSources: LightSourceList] RETURNS [r, g, b: REAL]; DiffuseAndSpecularReflectance: PROCEDURE [eyePoint: Point3d, surfaceNormal: Vector3d, surfacePt: Point3d, surfaceColor: Color, lightSources: LightSourceList] RETURNS [r, g, b: REAL]; SimpleFilmIrradiance: PROCEDURE [radiance: REAL, omegaAperture: REAL] RETURNS [irradiance: REAL]; SolidAngle: PROCEDURE [surfacePoint: Point3d, areaAperture: REAL] RETURNS [omegaAperture: REAL]; LamFilmIrradiance: PROCEDURE [surfaceNormal: Vector3d, lightSource: LightSource, albedo: REAL _ 1, omegaAperture: REAL] RETURNS [irradiance: REAL]; END. πFile: SVShading.mesa Last edited by Bier on February 18, 1987 6:22:01 pm PST Copyright c 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 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. CollimatedLambertianRadiance: PROCEDURE [surfaceNormal: Vector3d, 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. r, g, b will be roughly in the range [0..1], but may actually be larger than 1. Frank Crow's highlighted intensity model. r, g, b will be roughly in the range [0..1], but may actually be larger than 1. CollimatedSpecularRadiance: PROCEDURE [surfaceNormal: Vector3d, lightSource: LightSource, albedo: REAL _ 1] RETURNS [radiance: REAL]; Collimated light source at lightSource. Specular surface with given albedo oriented by given surfaceNormal. Assumes aperture at [0,0,0]; A convenience routine which combines CollimatedLambertianRadiance and SiMpleFilmIrradiance. SpecFilmIrradiance: PROCEDURE [surfaceNormal: Vector3d, lightSource: LightSource, albedo: REAL _ 1, omegaAperture: REAL] RETURNS [irradiance: REAL]; A convenience routine which combines CollimatedSpecularRadiance and SimpleFilmIrradiance. Κ9– "cedar" style˜Iheadšœ™Jšœ7™7Jšœ Οmœ1™