------ ----- ---- --- -- - -- - ----- ------
Adrian Scott, Ph.D.
Scott Virtual Theme Parks, [email protected]
http://www.clark.net/pub/theme <--changed URL
*** Is your avatar wearing any underwear? ***
---------- Forwarded message ----------
Date: Tue, 9 May 1995 10:21:48 -0700
From: Chris Schoeneman <[email protected]>
To: Scott Virt Theme Parks <[email protected]>
Subject: Re: TECH - by popular demand
First a disclaimer. These are only my interpretations of the VRML spec.
I make no guarantees of correctness since the spec is rather vague. My
guesses are based on the VRML spec, Inventor, and OpenGL.
> So, two questions about these colors:
>
> a) what do these colors mean?
>
> I think AMBIENTCOLOR would mean like color unaffected by lights.
> DIFFUSECOLOR would mean color affected by lights (shading etc.).
> SPECULARCOLOR, I have little clue about.
> EMISSIVECOLOR, would that be like the object emitting light, some
> lightbulbish properties? Would the emissiveness be related to the
> SHININESS parameter that follows? (And would any of these colors be
> related to the TRANSPARENCY parameteer?)
Ambient light is uniform in all directions, (crudely) simulating light
that has been reflected by surfaces in the environment. The ambient
color of a material is almost always the same as the diffuse color
uniformly scaled down. For example, an object with a color of
(0.8, 0.6, 0.7) might have an ambient color of (0.16, 0.12, 0.14).
Each light adds a contribution:
AmbientColor * LightColor * LightIntensity.
Diffuse reflections scatter light in all directions, simulating a matte
surface. Each light adds a contribution of:
max(n . l, 0) * DiffuseColor * LightColor * LightIntensity,
where,
n is the unit surface normal at the vertex, and
l is a unit vector in the direction of the light source.
Specular reflections are mirror-like reflections, simulating shiny
surfaces. Each light adds a contribution of:
(SpecularTerm ^ ShininessTerm) * LightColor * LightIntensity,
where,
SpecularTerm is a measure of how close the reflection of
the vector from the eye to the vertex about the surface
normal is to the vector from the surface to the light
source (i.e. how close the light is to the mirror direction)
The SpecularTerm is raised to the power of ShininessTerm. The higher
the ShininessTerm, the more concentrated the specular highlight and the
more polished the surface will appear. The ShininessTerm is the
material Shininess multiplied by some unspecified constant. On an
OpenGL based viewer, the constant is almost certainly 128.
EmissiveColor is self-emitted light. This light isn't really a light
source because it doesn't affect other surfaces. EmissiveColor is
light that is unaffected by lights and is an easy way to add in a
constant light contribution to a surface. EmissiveColor adds a
contribution of:
EmissiveColor
Transparency affects all the above colors in that it is applied last.
After the color of the vertex due to all light sources and the emissive
color has been computed, transparency is applied.
> b) would it make sense for an object to have more than one kind of color
> at once?
Yes. Perhaps the best example is plastic vs. metal (or more generally
dielectrics vs. conductors). Look at some plastic object, say a shiny
red ball. Under a white light, the ball looks red but the reflection
of the light looks white. This material has a red diffuse (and ambient)
color, but a white specular color. Metals, otoh, generally have a
specular color the same as the perceived color of the surface. Gold
has golden highlights. Smooth metal surfaces also usually have a much
darker diffuse component, often close to black, because they are mirror-
like.
> c) are these the kind of questions that I am stupid to be asking, and I
> should really be reading something like the Open Inventor spec? (since
> there's nothing about them in the VRML spec.)
Introductory computer graphics books often go into a basic lighting
model such as this. The concepts are the same even if the details
differ. Since the VRML spec is so vague, the details hardly matter at
this point.
Cheers,
-chris