# LWJGL 3 - problem with flickering when rendering terrain with colors

For while now I m trying to built a terrain generator for my game engine and again I'm stuck with problem.

I'm trying to generate a terrain using colors, so no textures. In short my problem is flickering. Hope this pictures will describe better my problem.

The way I'm generating this is using shared vertices. If I'm generating 2*2 terraing, I'm actually only creating 9 points. Something like this.

For color , I made that every second point will get slightly darker green.

When I add height generation, there is no flickering.

EDIT: It probably got something to do with using shared points. I now tried using all unique points for each square and no flickering.

EDIT: I found was the cause. I was generating indices wrong way.

    public void generateSharedIndices(int rowVertices,int columnVertices){
for(int row = 0; row < rowVertices - 1 ; ++row){
for(int column = 0; column < columnVertices -1 ; ++column){
int leftDownPoint = ((row * columnVertices) + column);
int rightDownPoint = leftDownPoint + 1;
int rightUpPoint = rightDownPoint + columnVertices;
int leftUpPoint = rightUpPoint - 1;