Hi!
I store some datas into an SSBO but I’ve a problem, for the first triangle the data are correct in the shader but not for the second.
Here is my struct :
struct Triangle {
mat4 transform;
mat4 textureMatrix;
vec4 position[3];
vec4 color[3];
vec4 texCoords[3];
vec4 normal;
uint textureIndex;
uint refractReflect;
float ratio;
};
For the first triangle the transformation matrix is this :
1 0 0 0
0 1 0 0
0 0 1 0
-450 -500 0 1
But for the second triangle there is a problem the values are offseted and I get this :
0 0 0 0
1 0 0 0
0 1 0 -450
-500 0 1 0.0009…
The last value is the first value of the texture matrix.
How to solve this alignement problem ?
Thanks.