Hi,
Does anyone know what are the parameters r and q to specify when using NvAPI_GPU_SetScanoutWarping ? For each vertex of the warping mesh, the following values must be specified (in the warping data structure NV_SCANOUT_WARPING_DATA) :
- x,y : mesh coordinates per-display rectangle
- u,v : texture coordinates in desktop space
- r,q : perspective mapping to simulate 3D warp
I know what are the x,y,u,v values but I have no idea what values to specify for r and q.
The only documentation I found about warping is in http://on-demand.gputechconf.com/gtc/2012/presentations/S0322-GTC2012-Warping-Blending-Systems.pdf on slides 20 to 22. An illustration of perspective mapping is in slide 21.
A sample code is in slide 22 :
float vertices[numVerts*6] ={x0,y0,u0,v0,r,q, x1,y1,u1,v1,r,q, …};
NV_SCANOUT_WARPING_DATA warpingData;
warpingData.version = NV_SCANOUT_WARPING_DATA_VER;
warpingData.numVertices = numVerts;
warpingData.vertexFormat = NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ;
warpingData.vertices = vertices;
warpingData.textureRect = osRect;
int sticky = 0; // output - Reserved field for future use
int maxNumVertices = 0; // output – returns the #pixels at scanout
// This call does the warp
NvAPI_Error error = NvAPI_GPU_SetScanoutWarping(displayId, &warpingData, &maxNumVertices, &sticky);
I will be very happy if anyone can give me a clue about the meaning of these r,q parameters.
Regards,
Loïc