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.
Hey thanks for the reply, I got the parallax working. It’s all running on the vertex shader now so im really happy with the performance.
I had still did not get the tangent semantic working, though. I exported a couple fbx planes from blender with the tangent option on. But once i had it imported the data never showed up.
Did some googling and I saw others had this problem too. Not sure if it is a problem with the blender exporter or the playcanvas inporter tho.
Nice you got it to work.
Playcanvas fbx importer does not export tangent space to glb files. You could work around that by using glb directly most likely, nothing from those gets stripped.