Re: Java3D + OpenGL ES
Posted by ThomasR on Jan 22, 2019; 5:01pm
URL: https://forum.jogamp.org/Java3D-OpenGL-ES-tp4039401p4039413.html
Thanks Phil,
LineArray and LineStripArray not rendering as nicely might be an issue depending how it looks.
Here's a code snippet showing our use of Texture2D:
Texture2D texture = new Texture2D(Texture.BASE_LEVEL, getTextureType(new_image_type), current_image.getWidth(), current_image.getHeight());
ImageComponent2D image2d = new ImageComponent2D(getImageComponentType(new_image_type), new_image, true, true);
image2d.setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
image2d.setCapability(ImageComponent.ALLOW_IMAGE_READ);
texture.setImage(0, image2d);
texture.setMinFilter(Texture.BASE_LEVEL_POINT);
texture.setMagFilter(Texture.BASE_LEVEL_POINT);
tile.setImageComponent(image2d);
TextureAttributes texture_attributes = app.getTextureAttributes();
texture.setEnable(true)
app.setTexture(texture)
I would have to determine the impact of not have the minification/magnification filter
We make heavy use of (From the original Java3D doc) for efficiency:
public ImageComponent2D(int format,
java.awt.image.BufferedImage image,
boolean byReference,
boolean yUp)
Constructs a 2D image component object using the specified format, BufferedImage, byReference flag, and yUp flag. The image class is set to ImageClass.BUFFERED_IMAGE.
Parameters:
format - the image component format, one of: FORMAT_RGB, FORMAT_RGBA, etc.
image - the BufferedImage used to create this 2D image component
byReference - a flag that indicates whether the data is copied into this image component object or is accessed by reference
yUp - a flag that indicates the y-orientation of this image component. If yUp is set to true, the origin of the image is the lower left; otherwise, the origin of the image is the upper left.
Tom