Today I was finally able to upgrade the MESA3D libraries using DRI HW accelleration on my Ubuntu 10.10 installation.
The upgrade fixed a lot of problems, in particular the rendering of the meshes now don’t have anymore the strange artifacts of polygons blinking around. Not bad, nice start.
Having finally apparently solved the situation I started to work in the real OpeGL ES 2.0 porting and in particular the rewriting of the Hemi Light shader, a shader that I have already successfully implemented before the move to ES20 and the absence of the matrix transformation functions.
The real issue I have had was the replacement of the standard built in OpenGL vertex shader functions such as the gl_NormalMatrix function which is very widely used in the common shaders.
I have checked around and the best I have found was that the function is the transpose of the inverse of the upper leftmost 3×3 of gl_ModelViewMatrix.
I have therefore implemented by own transpose matrix function considering only the leftmost 3×3 sub matrix of the 4×4 model matrix and this very simple function was created:
void PATRIA_Matrix_Transpose(PATRIA_Matrix3 *result, PATRIA_Matrix *srcA){
What is very strange is that the artifacts are not visible on all the situations. For instance here it looks quite good: