I have a model made in blender, which I've exported as a collada file. When loading it in my game engine, I get the result as shown in picture A. The code used to calculate the tangents are shown in picture B. If I set the tangents to something like (1,1,1) I get a much more smooth result but it gets very blocky in the places where there's supposed to be fine details (on high poly models). If I export the model to obj-format and load it in my engine through another pipeline, which uses the same code for calculating the tangents, the result is perfect. Does collada order the vertices in a strange order? I'm confused here and pretty much stuck. any tips would be appreciated.
I'll start by showing what happens when I load a simple box with 8 vertices, a texture and a normal map, this is collada format as well.
Here's two boxes, the exact same model, using the exact same shader and textures, the only difference is that the faulty one is imported as a collada and the correct one is imported as .obj
Here's another strange thing, the vertex positions in the collada file and .obj file doesn't match at all, there's not even any mention in the collada file of the vertices that are supposed to be at -0.004383! perhaps this discrepancy can be a part of the problem? Do anyone know why this is the case?