Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (3 posts)

Tangent0 and Binormal0 missing

Last post 12/29/2010 11:17 PM by Peter Prins. 2 replies.
  • 12/29/2010 9:32 PM

    Tangent0 and Binormal0 missing

    Hello, I'm following a tutorial to create a normal mapping shader. For the shader I need to provide the tangent and the Binormal of each vertex. The tutorial claims that XNA's Model class should take care of this for me, however when I run the program I get an InvalidOperationException at the mesh.Draw() call that says it is missing Tangent0. The tutorial is written for XNA 3 while I'm using XNA 4. Does anyone know what I'm doing wrong?
  • 12/29/2010 10:58 PM In reply to

    Re: Tangent0 and Binormal0 missing

    Answer
    Reply Quote
    You need to set the model processor parameter to tell it to generate this data.

    See:

    http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.content.pipeline.processors.modelprocessor.generatetangentframes.aspx

    http://blogs.msdn.com/b/shawnhar/archive/2007/11/26/content-processor-parameters-in-xna-game-studio-2-0.aspx

  • 12/29/2010 11:17 PM In reply to

    Re: Tangent0 and Binormal0 missing

    Shawn Hargreaves:
    You need to set the model processor parameter to tell it to generate this data.

    That solved it, Thank you so much.
    I tried to do something with the MesHelper.CalculateTangentFrames method, but could not get visual studio to import the references correctly.
Page 1 of 1 (3 posts) Previous Discussion Next Discussion