I try Intro07, changing "gridSmall.jpg" to an arbitrary image with half-transparent areas or feathered transparency around the edges.
What I see is a sharp edge with full transparency where the alpha value is zero, and completely opaque material mixed with my translucent image where the alpha value is between 1 and 255.
Do I need to use something like tex2d.setCombineModeAlpha(Texture2D.GL_BLEND);
with some other value besides GL_BLEND? How do I make my image to be used with its own translucency and no underlying material directly as the final texture? Can I also set my image to be emissive?
I will want it in a BufferedImage rather than a JRViewer, but I think I can figure that out myself from what I've looked over before.
This is how Java3D works with the following code:
Code: Select all
Appearance appearance = new Appearance();
try {
File file = new File(filename);
TextureLoader textureLoader = new TextureLoader(ImageIO.read(file));
Texture texture = textureLoader.getTexture();
appearance.setTexture(texture);
} catch (IOException e) {
e.printStackTrace();
}
TransparencyAttributes ta = new TransparencyAttributes();
ta.setTransparencyMode(TransparencyAttributes.BLENDED);
appearance.setTransparencyAttributes(ta);
Thanks.