Jump to content

  • Log In with Google      Sign In   
  • Create Account


Pixel shader to project a texture to an arbitary quadrilateral


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Prasoon Pankaj   Members   -  Reputation: 104

Like
0Likes
Like

Posted 23 September 2011 - 09:01 PM

Just need to figure out a way, using Pixel Shader, to project a texture to an arbitary user-defined rectangle.

Will be accepting coordinates of the four sides of a quadrilateral:


/// <defaultValue>0,0</defaultValue> 
float2 TopLeft : register(c0); 
 
/// <defaultValue>1,0</defaultValue> 
float2 TopRight : register(c1); 
 
/// <defaultValue>0,1</defaultValue> 
float2 BottomLeft : register(c2); 
 
/// <defaultValue>1,1</defaultValue> 
float2 BottomRight : register(c3); 



Tried couple of interpolation algorithm, but couldn't manage to get it right.

Is there any sample you guys think which I might be able to modify to get the desired result?

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS