D2DGetInputCoordinate 函式

傳回輸入 TEXCOORDN 的值。 僅適用于複雜的輸入。

語法

float4 WINAPI D2DGetInputCoordinate(
  in uint N
);

參數

N [in]

輸入編號。

傳回值

函式會以 TEXCOORDN 格式傳回 float4

備註

此函式傳回的座標位於紋素空間中。 著色器不應該對此值的計算方式採取任何相依性。 它應該只使用它來取樣圖元著色器的輸入。 如需詳細資訊,請參閱 將圖元著色器新增至自訂轉換

下列範例顯示用於位移地圖效果的函式。

float2 GetDisplacementOffset(float4 uv0, float4 uv1)  
{  
    // TODO: return the displacement offset 
}  
  
D2D_PS_ENTRY(DisplacementMapBilinear)  
{  
    const float4 coord0 = D2DGetInputCoordinate(0);  
    const float4 coord1 = D2DGetInputCoordinate(1);  
    return D2DSampleInput(0, GetDisplacementOffset(coord0, coord1) * coord0.zw + coord0.xy);  
}  

規格需求

需求
標頭
D2d1effecthelpers.hlsli
DLL
D2d1.dll

另請參閱

效果著色器連結

HLSL 協助程式