2

I’m pulling in models that, more often than not, have no normals and no tangents. I was disappointed to see this line in the comments for aiProcess_CalcTangentSpace:

"Does nothing if a mesh does not have normals.ā€

The problem here is, my mesh does have normals, but they were just calculated by aiProcess_GenSmoothNormals .

Is there any way to do an additional post process pass after generating the normals? I could definitely write code to generate tangents myself, but I trust the assimp team's tangent generating skills more than mine .

UPDATE: I found that you could apply additional post process steps through the use of the Importer's member function "ApplyPostProcessing(UINT flags)"

The problem is that despite doing this, my model still has no tangents or bitangents. This screenshot sums up the problem pretty easily: Tangents not calculated despite normals being present

Thank you for reading

Nico
  • 1,181
  • 2
  • 17
  • 35
  • From what I learned, you need to have UV coords first, since tangents and bitangents seemed to be defined to point along texture axis – sub_o Dec 17 '13 at 19:38

1 Answers1

1

UPDATE: Nope, for some reason the additional post process isn't generating the tangents... Something fishy is happening here.

Ouch, I read the manual a bit closer and answered my own question quite quickly.

It looks like running this function AFTER generating the normals will do the trick: ASSIMP_API const aiScene* aiApplyPostProcessing ( const aiScene * pScene,
unsigned int pFlags)

http://assimp.sourceforge.net/lib_html/cimport_8h.html#a09fe8ba0c8e91bf04b4c29556be53b6d

Nico
  • 1,181
  • 2
  • 17
  • 35