Hello, I am working on a parallax shader where multiple layers can be displayed with appearent distance between the layers.

To determine how much i have to shift the UVs around to produce parallax I need to know the camera view angle in tangent space.

I read up on tangent space an found an implentation for playcanvas in post: [SOLVED] Add skinning code to a custom shader

I use the normal and tangent semantic to construct a TBN world-to-tangent matrix.

It works as it is supposed to. But i found that the tangent value, that is gotten through the pc.SEMANTIC_TANGENT is an empty vector (0,0,0).

I tested this by passing the tangent to the fragment shader and displaying the vector as color. Only blackness showed up.

Another problem I ran into is that when I hardcoded a value as the tangent, the effect only works on a plane that has not been rotated. I thought rotation would not be an issue since the tangent is multiplied by the model_matrix when it is used to make the TBN matrix.

link to project: PlayCanvas | HTML5 Game Engine

Let me know if I need to provide more info.

Thanks in advance.