So… that is what I found out following your suggestions:
1 standard ffp smooth shading: same problem
2 flat shading: no problems ( see picture attached)
3 half vector in the fragment: same problem;
4 gl_FragColor to the normal: same problem( see picture attached)
I think it’s because normals are calculate or assigned
Do you think the the cross could be due to the fact that opposite vertex in the quad have the same normal value ?
I don’t wan to bother you with code but please if you could check how I calculate normals I would really appreciate:
Vec3 diff0=new Vec3(0,0,0);
Vec3 diff1=new Vec3(0,0,0);
Vec3 diff2=new Vec3(0,0,0);
Vec3 diff3=new Vec3(0,0,0);
Vec3 diff4=new Vec3(0,0,0);
Vec3 diff5=new Vec3(0,0,0);
if((col+1)<numberOfParticles)
diff0=Vec3.subtract(getPosition(row, col+1), getPosition(row, col));
if(((col+1)<numberOfParticles) && ((row+1)<numberOfParticles))
diff1=Vec3.subtract(getPosition(row+1, col+1), getPosition(row, col));
if((row+1)<numberOfParticles)
diff2=Vec3.subtract(getPosition(row+1, col), getPosition(row, col));
if((col-1)>-1)
diff3=Vec3.subtract(getPosition(row, col-1), getPosition(row, col));
if(((col-1)>-1) && ((row-1)>-1))
diff4=Vec3.subtract(getPosition(row-1, col-1), getPosition(row, col));
if(((col+1)<numberOfParticles) && ((row-1)>-1))
diff5=Vec3.subtract(getPosition(row-1, col+1), getPosition(row, col));
Vec3 normSum=Vec3.crossProduct(diff1, diff0).toVersor().sum(Vec3.crossProduct(diff2, diff1).toVersor()
.sum(Vec3.crossProduct(diff3, diff2).toVersor()
.sum(Vec3.crossProduct(diff4, diff3).toVersor().sum(Vec3.crossProduct(diff5, diff4).toVersor()))));
Vec3 normal = normSum.toVersor();
normSum.glNormal3d(gl);
getPosition(row, col).glVertex3d(gl);
Thank you