Help needed to get HLSL code frag to GLSL

Started by
2 comments, last by MARS_999 18 years, 8 months ago
I can't get this code of HLSL to convert to GLSL???

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);

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.
Advertisement
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;
Hmmm. here is what I got and get...
    n = view_matrix * gl_Normal;    t = view_matrix * Tangent;    b = view_matrix * Binormal;


invalid operands to mul
Forget it I got it... :)

This topic is closed to new replies.

Advertisement