Sign in to follow this  
JohnnyCode

point vector to texture space

Recommended Posts

hello, I wonder, is it possible to transform an object space point vector by a tangent matrix to texture space? Becouse I have heard that tangent matrix only rotates direction vectors. I would like to move an object space position vector to 3dimensional texture space. It is becouse I would like to then subtract [u,v,0] point from it thus have a very precise light direction vector. I also do not very well understand interpolators on vertex output-> pixel input transfer. In general you set the light direction in vertex shader but direction is different for every pixel on the triangle anyway for a point light for example. Moving to texture space sounds like an option to perform vertex operations with pixels. I am curious for the results, gonna dig it right away ...>

Share this post


Link to post
Share on other sites
I have two results:
1- I transformed not normalized vector to texture space and measured its length in pixel shader... good result (I think this is thanks to interpolators)
2- I transformed a position vector to texture space and subtracted [u,v,0] from it... bad result

So guys, come on, can a tangent matrix transform position vectors? If not, what matrix could do so? Lets find such a matrix, might come in handy.

Share this post


Link to post
Share on other sites
What is a "tangent" matrix? I'm not familiar with the term.

If you want to map 3D space to 2D texture coordinate space in a linear way, then yes, there is an affine matrix which can do that. Is that what you want?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this