Reply – Aviatrix3D JOGL Problem
Your Name
Subject
Message
or Cancel
In Reply To
Aviatrix3D JOGL Problem
— by Arvid Arvid
aviatrix3d-logging.log

Hello,

I have a problem with OSGI, Aviatrix3D and JOGL (Java 8; JOGL 2.3.2; Windows 10; Nvidia Titan X)
First, this test class with only JOGL works:

@Component(immediate = true)
public final class JOGLExample {
   
    private GLWindow window;
   
        @Activate
    private void activate() {
       
        final GLProfile profile = GLProfile.get(GLProfile.GL2);
        final GLCapabilities caps = new GLCapabilities(profile);
   
        this.window = GLWindow.create(caps);
        this.window.setTitle("JOGL OSGi");
        this.window.setSize(640, 480);
        this.window.setVisible(true);
       
        GLContext context = this.window.getContext();
        context.makeCurrent();
       
        final GL2 gl3 = context.getGL().getGL2();
        gl3.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
        gl3.glClear(GL.GL_COLOR_BUFFER_BIT);
       
                context.release();
        this.window.display();
       
    }
   
        @Deactivate
    private void deactivate() {
       
        this.window.setVisible(false);
        this.window.destroy();
    }
}

But a test class with Aviatrix3D throws Exceptions (see logging.log attachment)!
I had a look to the Aviatrix3D classes and found in the Surface classes that init of JOGL:

SimpleAWTSurface (extends BaseAWTSurface):

GLDrawableFactory fac = GLDrawableFactory.getDesktopFactory();
AbstractGraphicsDevice screen_device = fac.getDefaultDevice();
GLProfile selected_profile = GLProfile.get(screen_device, GLProfile.GL2);

GraphicsRenderingCapabilities caps = GraphicsRenderingCapabilities();

GLCapabilities jogl_caps = CapabilitiesUtils.convertCapabilities(caps, selected_profile);
GLCapabilitiesChooser jogl_chooser = chooser != null ? new CapabilityChooserWrapper(chooser) : null;

canvas = new GLCanvas(caps, chooser, null);
canvas.setAutoSwapBufferMode(false);
canvasRenderer = new StandardRenderingProcessor(this);
canvasRenderer.setOwnerBuffer(canvasDescriptor);
canvas.addGLEventListener(this);

Later, the GLCanvas will set to a AWT-Frame.

The GraphicsRenderingCapabilities class has this values:

        /** Number of bits for the red component of the primary buffer. Default value 8 */
    public int redBits  = 8;
    /** Number of bits for the green component of the primary buffer. Default value 8 */
    public int greenBits = 8;
    /** Number of bits for the blue component of the primary buffer. Default value 8 */
    public int blueBits = 8;
    /** Number of bits for the alpha component of the primary buffer. Default value 0 */
    public int alphaBits = 0;
    /** Flag to enable double buffered rendering. Default value is true */
    public boolean doubleBuffered = true;
    /** Number of bits for the depth buffer. Default value 16 */
    public int depthBits      = 16;
    /** Number of red bits for the accumulation buffer. Default value 0 */
    public int accumRedBits   = 0;
    /** Number of green bits for the accumulation buffer. Default value 0 */
    public int accumGreenBits = 0;
    /** Number of blue bits for the accumulation buffer. Default value 0 */
    public int accumBlueBits  = 0;
    /** Number of alpha bits for the accumulation buffer. Default value 0 */
    public int accumAlphaBits = 0;
    /** Number of bits for the stencil buffer. Default value 0 */
    public int stencilBits    = 0;
    /**
     * Flag to enable the use of floating point, rather than integer buffer
     * for rendering. Only used for offscreen drawables such as MRTT and FBOs.
     * Defaults to false
     */
    public boolean useFloatingPointBuffers = false;
    /**
     * Flag to enable the use of MSAA sample buffers when rendering. Defaults
     * to false.
     */
    public boolean useSampleBuffers = false;
    /**
     * If {@link #useSampleBuffers} is true, this is the number of samples
     * to use per output pixel. Default value of 2.
     */
    public int numSamples = 2;
    /**
     * Support for transparent windows containing OpenGL content. When this is false, the values
     * of the transparentValues are used to determine which parts of the rendering should be considered
     * as transparent
     */
    public boolean backgroundOpaque = true;
    /**
     * If the red value is this value, then it is part of the transparent section of the
     * rendering when {@link #backgroundOpaque} is set to false. In order for the transparency
     * to render, all 4 values must match. Default value 0
     */
    public int transparentValueRed = 0;
    /**
     * If the green value is this value, then it is part of the transparent section of the
     * rendering when {@link #backgroundOpaque} is set to false. In order for the transparency
     * to render, all 4 values must match. Default value 0
     */
    public int transparentValueGreen = 0;
    /**
     * If the blue value is this value, then it is part of the transparent section of the
     * rendering when {@link #backgroundOpaque} is set to false. In order for the transparency
     * to render, all 4 values must match. Default value 0
     */
    public int transparentValueBlue = 0;
    /**
     * If the alpha value is this value, then it is part of the transparent section of the
     * rendering when {@link #backgroundOpaque} is set to false. In order for the transparency
     * to render, all 4 values must match. Default value 0
     */
    public int transparentValueAlpha = 0;
       
This looks like (found in Line 4155):
GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.sw]

I hope, someone can help me to unerstand whats happend.

Kind regards
Arvid