>Date: Wed, 17 Jul 2002 13:58:10 -0700
>From: Justin Couch <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] Help with Alpha-only textures
>To: Kelvin Chung <[EMAIL PROTECTED]>
>Cc: J3D Interest List <[EMAIL PROTECTED]>
>MIME-version: 1.0
>Content-transfer-encoding: 7bit
>X-Accept-Language: en-us, en
>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0)
Gecko/20020530
>
>Kelvin Chung wrote:
>
>>    Just some information which may help from OpenGL
>> specification for GL_ALPHA base internal format
>>
>> Replace Texture Function
>> ----------------------------
>> C = Cf
>> A = At
>
>Now that is interesting and seems counter-intuitive compared to the J3D
>docs, because that is different to the J3D spec for the same thing:
>
>o REPLACE - replaces the incoming color with the texture color.
>
>C' = Ct

Yes, the specification assume RGB texture and is not clearly
mention the ALPHA texture case which doesn't have Crgb.

Doc bug 4698350

  - Spec. did not mention alpha component for Texture Mode
    REPLACE, MODULATE clearly

is already submitted for this.

Here is the complete table for your reference:

InternalFormat    Replace Modulate  Decal        Blend
-----------------------------------------------------------
GL_ALPHA        C'= Cf     Cf     undefined        Cf
                A'= At     Af*At  undefined       Af*At

GL_LUMINANCE        Lt     Cf*Lt  undefined      Cf(1-Lt)+Cc*Lt
                    Af     Af     undefined        Af

GL_LUMINANCE_ALPHA  Lt     Cf*Lt  undefined      Cf(1-Lt)_Cc*Lt
                    At     Af*At  undefined       Af*At

GL_INTENSITY        It     Cf*It  undefined      Cf(1-It)+Cc*It
                    It     Af*It  undefined      Af(1-It)+Ac*It

GL_RGB              Ct     Cf*Ct    Ct           Cf(1-Ct)+Cc*Ct
                    Af     Af       Af             Af

GL_RGBA             Ct     Cf*Ct Cf(1-At)+Ct*At  Cf(1-Ct)+Cc*Ct
                    At     Af*At     Af           Af*At

where
 Ct is the RGB color of Texture and
 At is alpha of texture.
 Cf, Af is the polygon color and alpha
 It  is the intensity of texture
 Lt  is the luminance of texture
 C' and A' is the resulting Color and Alpha.


>
>It doesn't say anything about the various texture types and their effect
>and nor does the J3D tutorial. To me, replace would set the other
>colours to either black or white if the texture doesn't have that colour
>component. It doesn't appear to be doing that though as it just sets the
>entire texture to clear. Can you add that as an RFE for the Javadoc - we
>need a table in the documentation that maps the Texture type (LUMINANCE,
>ALPHA) etc with the colour mapping.
>
>Of course, I'm using the D3D version of J3D, not OGL, so that may have
>something completely different. In either case, it is still not working
>and I don't see anything in the README about it not working. The polygon
>is double-sided lit and has no underlying transparency (at least in this
>test case, it may have in a VRML file).
>

DirectX is implement according to the above specification.
So the behavior is the same as OpenGL.


>Annnnnyway. I'll try to find out who is going to end up at Siggraph and
>see if they can have a look at the code.
>
>
- Kelvin
-----------------
Java 3D Team
Sun Microsystems Inc.

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