Vertex Arrays + Lighting = Flickering?

Hi there,

I’ve recently ported the geometry/mesh part of my jogl engine to vertex arrays to be prepared for using vertex buffers lateron and to enable some of the more fancy effects like bumpmapping.

The problem: When I render geometry using glDrawArrays, bright faces flicker, meaning they vary in brightness with no apparent reason.

So, question #1: Are vertex arrays known to cause problems with lighting?

I’ve already played with normals and lights without results. Funny, but even when I activate cubemapping, my previously flawless skybox cubemap gets mixed up, with wrong portions being rendered and areas remaining untextured. Hmmm … lighting is disabled, and texture coordinates should be computed automatically, and the cube mesh is fine.

So, question #2: Are vertex arrays known to completely s***? (Please excuse my frustration :frowning: )

By the way, I’m working with an ATI 9600 on a Dual-Xeon, WindowsXP, all the latest drivers installed.

Thanks

Wolfgang

Vertex arrays are about the only thing that I found to work in Jogl :wink:

Vertex arrays should produce identical results to immediate mode if you’re doing things correctly. However what with the use of buffers and the slightly non-obvious function args theres a few bits where you could have gone wrong. If you’ve not already tried it then have peek in the wiki and see if that gives you any hints for using vertex arrays.

The one that always trips me up is that the last param for glDrawArrays is the number of vertices, not number of primatives. :-[ Also check where you enable and bind your position/color/normal buffers, and don’t do something silly like re-use one buffer for all of them.

Failing that, post the code. I’d guess that somehow your normal array is off-kilter.

Another observation: when I used GKW’s latest build to fix the sample buffer bug in 1b04 I got uncontrollable flicker on an ATI 7500. Both this card and an NVidia 5950 were fine, in that repect, on all other builds. I’ve had to go back to 1b03 for the moment.

I also use lit VBOs.

“I’d guess that somehow your normal array is off-kilter” How did you know? ;D Topic closed, it was the normal array.

Thanks for you help,

Wolfgang