glDrawElements + Vertex Array + High Polycount = No Lighting?

When I use glDrawElements on a model with a really high polygon count, opengl lighting stops working. This doesn’t happen if I use glDrawArrays, or if I use vertex buffer objects.

http://people.umass.edu/eraboin/elements.jpg

http://people.umass.edu/eraboin/arrays.jpg

The left picture is with glDrawElements, the right is with glDrawArrays. This only happens if the model has more than ~1500 vertices, but that’s not really a stable number. I want to know what’s causing this so I can avoid it in my program… but I want to keep using glDrawElements, and provide support for cards that can’t use vertex buffer objects.

Have you tried installing the DebugGL pipeline in your GLEventListener.init() method (see the Gears and other demos’ source code for examples)? Does it report any errors? I would guess you may be handing invalid indices to glDrawElements.

I have drawable.setGL(new DebugGL(drawable.getGL())); in the init() method of my GLEventListener. I don’t get any error messages.

However, since you brought it up, this is what the Gears demo looks like on my computer:

http://people.umass.edu/eraboin/gears.jpg

… notice the lack of lighting around the edges.

I’m using JOGL 1.1 b12, under WinXP SP1. I’ve got a Radeon 9800 PRO, with Omega drivers installed.

If it turns out that my computer is just acting strange, that’s actually ok. Because I can test it with VBOs instead, as long as vertex arrays will work for other users when they try it.

My guess is that it’s a bug in the Omega drivers.