lighting problems or artifacts

This screenshot…

…shows a terrain that I randomly generated using a fractal brownian motion algorithm, and then rendered using OpenGL with diffuse and ambient lighting. It’s made up of 64x64 vertices, and was constructed using GL_TRIANGLE_STRIP. If you look at the screenshot you’ll notice on the slopes of the hills some dark criss-cross banding, which seems to follow the edges of the original grid.

Anybody know why this might happen? I’m pretty sure that my normals are OK. I’m calculating them by averaging normals from the surrounding 8 triangles. I’ve heard of Mach banding, but I’m not sure if this is it. When I apply textures this banding tends to disappear or become much less noticeable, especially when the textures are darker. But I would like to get rid of it or minimise it as much as I can before applying textures.

This is an unfortunate result of the fact that OpenGL uses per vertex lighting. In other words all lighting calculations are carried out per vertex, NOT per pixel. The banding that you are seeing is a result of bilinear interpolation between the vertices.

To improve your results, either increase your grid density (easy solution), or go for per pixel lighting using fragment programs or similar (difficult solution).

marcus is absolutely right.

One thing you could try actually is the diamond rendering order.

Thanks guys.