Jump to content
  • Advertisement
Sign in to follow this  
Prasoon Pankaj

Pixel shader to project a texture to an arbitary quadrilateral

This topic is 2640 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

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:

[color="#808080"]

/// <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?

Share this post


Link to post
Share on other sites
Advertisement
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!