Getting tangent or binormal for a sop in GLSL?

Hi,
I am writing a deformer in glsl for a sop that comes into a geometry comp. For my deformer to work well, I need to pass in a tangent and/or a binormal. I get the normal in the glsl as ‘N’. Is there any way to get the other value?

Thanks in advance

You need to create the tangent attribute. You can use the Attribute Create SOP to do this. You can use a Phong MAT with normal mapping active and output the GLSL code from that to see how to use the N and T attributes to create the binormal.

I got it. I tried that, but I had to declare in the vertex shader:

in vec3 T;

Which I didn’t have to do for the normal

Yes, that’s correct. The only attributes which are declared for you are P, N and uv[]. Any other attributes will need to be declared manually