I've been debugging through a problem I've had the past couple days with lighting my terrain engine. Below are the before/after pics of the lighting problem and the same picture of it after the problem was fixed (notice the odd striping effect on the first pic).
This is the code now:
normalBuffer.put(i, normalMap.get(yPos, xPos).getX());
normalBuffer.put((i+1), normalMap.get(yPos, xPos).getY());
normalBuffer.put((i+2), normalMap.get(yPos, xPos).getZ());
These are vertex and normal arrays (I'm not using VBOs). The problem was I had the normalBuffer code above being placed after the vertexBuffer code. Now I realize in immediate mode that all the attributes of the vertex should be called before the glVertex draw code, but this is just populating the arrays for rendering later, so it is confusing me that this was the issue. Just wanting to know if anyone has some input on this.