GLCapabilities setSampleBuffers(true) stops painting

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GLCapabilities setSampleBuffers(true) stops painting

jeffreportmill
I am a JOGL newbie, still trying to figure out best practices to render basic 3D to (essentially) an offscreen BufferedImage. Still using immediate mode instead of shaders.

Things have been going well, but when I realized how pixelated my rendering was, I tried to activate Multisampling with setSampleBuffers(true) + setNumSamples(4). When I add these to my GLCapabilities, my painting freezes, even though the app is happily still running (display still gets called, and Swing paint still gets called, JOGL trace shows plenty of activity).

I have tried dozens of permutations of GLCapabilities and GLDrawable options, onscreen and off, but I still get the paint freeze. Any idea what I am doing wrong?

    Source:  http://reportmill.com/jogl/JoglTest.java

Somehow I think I have a buffer issue - like maybe it's rendering to a swapped out buffer. I really don't know what I'm talking about though.

Thanks!

jeff
Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

jeffreportmill
I should have mentioned my config:

     - MacOS Monterey 12.1, M1, JDK 1.8.0_241

     - Gradle: org.jogamp.jogl:jogl-all-main:2.3.2

     - Default Caps: 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.hw], on-scr[.]]

     - Config Caps: GLCaps[rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/4, sample-ext default, one, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]]

Any ideas on things to try for debugging?
Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

jeffreportmill
So I got it to work by changing my AutoDrawable to be:

            GLWindow glWindow = GLWindow.create(glCaps);

Instead of:

        GLDrawableFactory factory = GLDrawableFactory.getFactory(glProfile);
        GLAutoDrawable drawable = factory.createOffscreenAutoDrawable(null, glCaps, null, _width, _height);

The "Upstream Widget" for GLWindow is NEWT. For the second it is null. And while it works now, I have a bogus onscreen window for every offscreen AutoDrawable that I would have to hide somehow.

Any idea why it works for GLWindow and not GLDrawableFactory.createOffscreenAutoDrawable()?
Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

gouessej
Administrator
Have you tried with JOGL 2.4 RC?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

jeffreportmill
The only maven package I found were from a year ago, I think, and it is broken there as well:

    implementation 'me.friwi:gluegen-rt:v2.4.0-rc-20210111'
    implementation 'me.friwi:jogl-all:v2.4.0-rc-20210111'

I guess I need to try the jars.
Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

mahesh
You can try build for mac M1 from my repo https://github.com/maheshkurmi/jogl-macarm64-builds

Note that NEWT still does't work on mac M1. you will have to use GLcanvas.

Reply | Threaded
Open this post in threaded view
|

Re: GLCapabilities setSampleBuffers(true) stops painting

Martin
In reply to this post by jeffreportmill
There is a Maven server providing this RC as well as the next one allowing to run on MacOS M1.

https://github.com/jzy3d/jogl-maven-deployer#getting-jogl-24-rc-4-for-macos-bigsur-20211116