Any good ideas?

I upgraded my project to using the most recent jsr231 code. Not too great a change, but some small refactoring required.

The trouble I have now is that I’m getting a lot of flickering on lit objects (they appear to ficker between correctly lit and completely unlit, with the diffuse color showing through) and I’m getting a bit of screen tearing as well. I didn’t have these problems with the previous jogl version.

I’m not sure what the problem is and I’m fishing for some ideas as to what might be causing the issue :wink:

It’s not the gfx driver - I’ve got the latest and I’ve compared running with an earlier version, and there’s no difference. I can’t go back to the earlier code either - my hard drive completely died, and the only version of the code I had left is a recent version I’d sent to work to check if the flickering showed there, too.

I know this isn’t enough information to diagnose anything, I’m hoping for some ideas as to what I can check because I’m stumped ;D

Thanks!

I assume you saw the same flickering on two different machines? What are the kinds of graphics cards in each? What about OS, Java version, etc.?

Have you tried using the DebugGL to see whether there are any OpenGL errors reported?

Have you touched any of the properties in the GLCapabilities object you use to create your initial window? If so, have you tried using the defaults? Are you sure you’re getting double-buffering, etc.?

Are you using vertex arrays or VBOs? If so have you tried using immediate mode rendering just as a debugging technique?

Yes, it flickered on both machines. My home machine is a nvidia GeForce 6600. The work one is some kind on on-board crap thing ™ ;o) Both machines are Windows XP (home & pro) and Java version is 1.5.

Yes, I’m running with the Debug pipeline.

This is how I’m setting the caps - it did change in the refactoring. The commented out code was the old version.

GLCapabilities caps = new GLCapabilities();
caps.setDoubleBuffered(true);        
caps.setHardwareAccelerated(true);
    
//canvas = GLDrawableFactory.getFactory().createGLCanvas(caps);
canvas = new GLCanvas(caps);         

One of the objects flickering is a Quadric rendered in a DisplayList (going immediate mode doesn’t change the flickering). Another uses vertex arrays in a DisplayList (also makes no difference whether it’s in a DisplayList or not). Another object is an unlit Quadric (unlit because it’s the Sun!) and it doesn’t flicker at all. I’m also rendering some lines in immediate mode for debugging purposes - these don’t flicker. So it appears that just lit objects are flickering (it looks like they flicker between properly lit and fully bright with diffuse color).

Thanks for the help - I know this is pretty vague.

Try just passing a new GLCapabilities() to the GLCanvas constructor.

I’ve certainly seen weird issues like this in applications I’ve developed from time to time but nothing immediately comes to mind. You might want to see if you’re enabling texturing without binding a texture. If you can’t figure out what’s going on could you try to create a small test case and put it up somewhere?

Also check to make sure you’ve called rewind() on all of your NIO Buffers, as the position() is now significant in the JSR-231 API.

ok, thanks - I’ll give those ideas a go. Thanks for the prompts ;o)