Jump to content
  • Advertisement
Sign in to follow this  
JorenJoestar

SOLVED - Parallax/relief tangent

This topic is 3762 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 guys, here again to ask you something... I'm using a shader effect from cg library (relief mapping) but it won't work until I change the vertex program input declaration from float3 tangent : TANGENT; to float3 tangent : TEXCOORD1; ...I calculate normals and tangent outside shader, then binormal inside the shader...what am I doing wrong? The vertex declaration is good, directX in debug mode doesn't write anything wrong... Thanks! [Edited by - JorenJoestar on June 29, 2008 6:30:37 PM]

Share this post


Link to post
Share on other sites
Advertisement
It depends on where you're binding your tangents. According to your shader code, on the CPU you're binding the tangents to the second texture coordinates slot. If you want to use TANGENT0, then you simply need to bind the tangents to that semantic.

Share this post


Link to post
Share on other sites
it's strange...actually on texcoord1 there are the coords for the application of the normal map.
In the engine I calculate the tangent and bitangent and assign them to the vertex buffer with the proper declarations...maybe I'm calculating wrong tangents???

Share this post


Link to post
Share on other sites
SOLVED! Actually I was feeding the vertex buffer in the wrong location, so the hint you gave me was great! I learnt new things today...thanks!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!