Chasing some help understanding some of the 2D texture modes. It seems
they are not what they appear to be.

I'm trying to develop a texture-based solution for the VRML Text node.
To do this, I'm creating alpha-only textures to act as a "stencil" over
the geometry as the spec requires that the text be both lit with
material colours and textured (including possibly multi-texturing).
While I can get basic RGBA textures working fine, as soon as I swap the
texture to Texture.ALPHA I end up seeing nothing. Here's my rough code:

BufferedImage bi = new BufferedImage(...BufferedImage.TYPE_BYTE_GRAY);
Graphics g = bi.createGraphics();

// do a bunch of drawing here...

ImageComponent2D ic = new
    ImageComponent2D(....ImageComponent.FORMAT_CHANNEL8);
Texture2D texture = new Texture2D(...Texture.ALPHA);

TextureAttributes ta = new TextureAttributes();
ta.setTextureMode(TextureAttributes.COMBINE);
ta.setCombineRgbMode(TextureAttributes.COMBINE_REPLACE);
ta.setCombineAlphaMode(TextureAttributes.COMBINE_REPLACE);

ta.setCombineRgbSource(0, TextureAttributes.COMBINE_OBJECT_COLOR);
ta.setCombineAlphaSource(0, TextureAttributes.COMBINE_TEXTURE_COLOR);

ta.setCombineRgbFunction(0, TextureAttributes.COMBINE_SRC_COLOR);
ta.setCombineAlphaFunction(0, TextureAttributes.COMBINE_SRC_ALPHA);

etc. I've tried texture attributes with BLEND and MODULATE as well as
combine modes of COMBINE_BLEND, COMBINE_MODULATE as well as setting the
functions to ONE_MINUS_blah, but none of them ever result in something
visible on screen - no object, no texture, nothing :( Any suggestions on
what settings I need to come up with here to get the correct appearance?

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