# varying mat3 mymatrix

If I want to send a matrix from the vs to fs, do I have to do anything in particular in the fs?
Do I have to normalize it?

mymatrix = normalize(mymatrix);
mymatrix = normalize(mymatrix);
mymatrix = normalize(mymatrix);

You mean to normalize individual columns in a matrix which is left multiplied? That most likely changes the equations this matrix expresses. Don’t.

What exactly do you want to achieve?

Varyings are interpolated. If the matrix differs at the vertices which generate the primitive’s fragments, that will generate all sorts of matrices in between and you probably didn’t want that.

I’m doing bumpmapping but I have a shader that is complicated to do the bumpmapping in tangent space. I want to transform the normal to eye space in the fs.

I built a matrix ,in the vs, by putting in a tangent, binormal and normal in each row

T | T | T
B | B | B
N | N | N

I think I need to normalize each row when the matrix is in the fs

I want to transform the normal to eye space in the fs.
Transforming from screen space to eye space would just need the inverse projection.

I think I need to normalize each row when the matrix is in the fs
Right, but matrix is a column!
If you really need the basis trafo descibed by the normal, tangent and binormal, use three varying vec3, let them interpolate in the fragment shader, normalize those and then build you basis trafo matrix in the fragment shader.

Mind that interpolation can result in null vectors if incoming vectors are colinear and of opposite direction.

“Transforming from screen space to eye space would just need the inverse projection.”

Like I said, this is bumpmapping so normals are in tangent space.

Actually, I am putting values in matrix liek this

T | B | N
T | B | N
T | B | N

so normalizing the columns should be possible.
For the moment, I am not normalizing so I guess there would be some error.