Just need to figure out a way, using Pixel Shader, to project a texture to an arbitary user-defined quadrilateral.
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.
是否有你认为我能加以修改以取得预期结果的样本?