DIRECTORY GraphicsColor, Matrix3d, Rope, SVVector3d; Shading: DEFINITIONS = BEGIN Color: TYPE = GraphicsColor.Color; Vector: TYPE = SVVector3d.Vector; Point3d: TYPE = Matrix3d.Point3d; LightSource: TYPE = REF LightSourceObj; LightSourceObj: TYPE = RECORD [name: Rope.ROPE, position: Point3d _ [0,0,0], color: Color]; LightSourceList: TYPE = LIST OF LightSource; CollimatedLambertianRadiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL _ 1] RETURNS [radiance: REAL]; 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]; CollimatedSpecularRadiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL _ 1] RETURNS [radiance: REAL]; SimpleFilmIrradiance: PROCEDURE [radiance: REAL, omegaAperture: REAL] RETURNS [irradiance: REAL]; SolidAngle: PROCEDURE [surfacePoint: Point3d, areaAperture: REAL] RETURNS [omegaAperture: REAL]; LamFilmIrradiance: PROCEDURE [surfaceNormal: Vector, lightSource: LightSource, albedo: REAL _ 1, omegaAperture: REAL] RETURNS [irradiance: REAL]; END. "File: Shading.mesa Last edited by Bier on December 18, 1982 1:12 am Author: Eric Bier on July 3, 1983 1:21 pm 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. Collimated light source at lightSource. Lambertian surface with given albedo (0 to 1) oriented by given surfaceNormal. Frank Crow's highlighted intensity model 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: Vector, lightSource: LightSource, albedo: REAL _ 1, omegaAperture: REAL] RETURNS [irradiance: REAL]; A convenience routine which combines CollimatedSpecularRadiance and SimpleFilmIrradiance. Κ7– "cedar" style˜Iheadšœ™Jšœ0™0Jšœ)™)JšœΓ™ΓJšœE™EJ˜J˜šΟk ˜ Jšœ˜Jšœ ˜ Jšœ˜Jšœ ˜ —J˜Jšœ  œ˜Jš˜™Jšœξ™ξJšœΓ™ΓJšœσ™σJšœ"˜"Jšœœ˜!Jšœ œ˜!Jšœ œœ˜'Jšœœœ œ˜/Jšœ+˜+J˜Jšœœœœ ˜,Iproc˜š Οnœ œ;œœ œ˜…Lšœx™x—L˜Lš žœœ œaœž˜€L˜Lšžœ œtœ˜΄Lšœ,™,L˜š žœ œ;œœ œ˜ƒLšœl™l—L˜Lš žœ œ œœœœ˜aL˜š ž œ œ'œœœ˜`Lšœ™—L˜š žœ œ;œœœœ˜‘Lšœ[™[—L™Lš žœ œ;œœœœ™’™LšœZ™Z——Lšœ˜—…—4