D3DXComputeTangentFrame output?

Started by
2 comments, last by george7378 10 years, 11 months ago

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!

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 .

Niko Suni

^^^ 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.

Ah right - so it just modifies the mesh you put in. Thanks!

This topic is closed to new replies.

Advertisement