Pixel shader for projecting a texture into a rectangular quadrangle

You just need to figure out the way, using the Pixel Shader, to project the texture onto an arbitrary custom quad.

It will take the coordinates of the four sides of the quadrangle:

/// <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);

I tried a couple of interpolation algorithms, but could not cope with it.

Is there any sample that you guys think I can change to get the desired result?

+5
source share
2 answers

, ( .ppt). , BC .

, ; HW (. voidstar69) , .

+1

, 3D- , quadrilaterals. , Direct3D OpenGL , API . , , - .

API - , API/ . . , "", , ( , ).

, - ( , ).

+1

All Articles