float4x4 view_matrix;
// Rotate the basis vectors into view space
float4 nvector = float4(inNormal.x, inNormal.y, inNormal.z, 0.0);
float4 tvector = float4(inTangent.x, inTangent.y, inTangent.z, 0.0);
float4 bvector = float4(inBinormal.x, inBinormal.y, inBinormal.z, 0.0);
Out.Normal = mul(view_matrix, nvector);
Out.Tangent = mul(view_matrix, tvector);
Out.Binormal = mul(view_matrix, bvector);
Help needed to get HLSL code frag to GLSL
I can't get this code of HLSL to convert to GLSL???
I have tried the matrixCompMult() and that doesn't work. From what I have found out the mul() in HLSL multiplies matrixes... but float4 is just a vec4 in GLSL??
Any help appreciated.
that looks like a straight matrix * vector multiply to me, which is all you need todo in GLSL as well, for example : Normal = view_matrix * nvector;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement