Frederic Barachant wrote:
Hello.
I'm actually adding some more eye candy to my little thing, and wanted to put DOT3 bump,
some mapping.
I've got Shape3D objects, whose colors are set using the Material. I would like them to have
a bump and a texture to make the surface less flat and uniform.
Actually, the problems i encounter are:
- when i add the bump, the object losses its color, and gets a grey corresponding to the conversion
of the three colors (some kind of average)
- using vertex colors does not change anything to the color of the bump.
- adding colored mapping over the bump changes the color, but this is static coloring. i can't change it
without changing the mapping.
Correct. You have just described the correct function of the DOT3
algorithm. Remember that DOT3 takes two vectors as input to generate a
scalar value as output. One vector comes from the bump map, the other
vector has to come from somewhere. That other vector describes what the
light direction is. That other vector has to come from somewhere. If you
look at the combine equations, there is only one unused input color
value. There are two places that the combine mode allows you to provide
that color from: A constant color or the previous stage of the texture
pipeline. Either way, that "color" value is actually interpreted as the
light vector that is shining on the surface. A constant color is easy to
understand.  If you are taking the color from the previous stage of the
pipeline then it really doesn't matter what that color is, it is
interpreted as a vector. So, if you have used the bump map as the first
stage in the pipeline, then the underlying color is actually the object
color - ie per-vertex coloring represents the incident light, not a
color. That's why you are loosing the material color. As for the
greyscale output, that's because the output of the bump map is a scalar,
and is therefore applied to all color components equally, thus only
allowing grey values.

--
Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              http://www.yumetech.com/
Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
                                              - Greg Bear, Slant
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to