Alessandro Borges wrote:


BUT
 BlendFunc ( DST_COLOR, ZERO );
does this:
myBlendedPoly = myPolygon * background + background * 0;
or
myBlendedPoly = myPolygon * background ;

in other words it multiplies the color instead a simple add.

I can't seen a way to get that specific formula. I can get close though. Have a look at the BLEND mode. To do what you want, you would do this:

TransparencyAttributes t =
  new TransparencyAttributes(
     TransparencyAttributes.BLENDED,
     0,
     TransparencyAttributes.BLEND_ZERO,
     TransparencyAttributes.BLEND_SRC_ALPHA);


Note that j3D says the formula is:


srcBlendFunction * poly + destBlendFunction * background

In the setup above, that makes it:

0 * poly + polyAlpha * background

Close, but not quite what you want I think if the poly has alpha values.

OK ! So what ?
Quake3 use the following formula for multitexture:

myMultiTexPoly = (light + bump(s)) * texture + specular ;

As far I understand above good bump mapping effect needs a multiply.

Note that the only reason that Q3 does that is because they were doing multi-pass rendering of the textures to deal with the lack of the desired number of mutlitexture units in hardware. Q3 is the only realtime code that I've seen that adds the light map at the first stage as part of the dot3 product. That seems like a waste of a pass because the light direction changes per pixel, which isn't exactly true to life. You're better off using either the Blend Color or per-vertex color and then applying a proper light map over the top as a multiply, the finally add specular. However, I'll answer that part in the other email.....

--
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