Jump to content
  • Advertisement
Sign in to follow this  
george7378

D3DXComputeTangentFrame output?

This topic is 2051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone,

 

I'm looking into doing Normal mapping with HLSL, and I understand that you have to use D3DXComputeTangentFrame first. However, the function only takes in a mesh and flags - so what does it return? Do I get another mesh out? Does it give me vectors? How do I access the results? I'm a bit confused about what it gives me!

 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

The function updates the input mesh's vertex buffer with the new data. You need to have the tangent, normal and bitangent allocated in the mesh data in advance, even though they would initially be garbage.

 

To re-allocate a mesh with vertex elements of your choice, you can use ID3DXBaseMesh::CloneMesh .

Share this post


Link to post
Share on other sites

^^^ what Nik02 said. If you want to see an example, I'm pretty sure that the old ParallaxOcclusionMapping sample from the DirectX SDK can show you how to load a mesh, clone it, and generate a tangent frame.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!