Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 1.92 KB

d2dgetinputcoordinate.md

File metadata and controls

88 lines (59 loc) · 1.92 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
D2DGetInputCoordinate function (D2d1effecthelpers.h)
Returns the value of the input TEXCOORDN. Only available for complex inputs.
60125E23-53B3-45ED-89FE-684E79004F6B
D2DGetInputCoordinate function Direct2D
apiref
D2DGetInputCoordinate
d2d1.dll
DllExport
reference
05/31/2018

D2DGetInputCoordinate function

Returns the value of the input TEXCOORDN. Available only for complex inputs.

Syntax

float4 WINAPI D2DGetInputCoordinate(
  in uint N
);

Parameters

N [in]

The input number.

Return value

The function returns a float4, in the format TEXCOORDN.

Remarks

The coordinate returned by this function is in texel space. A shader shouldn't take any dependencies on how this value is calculated. It should use it only to sample the pixel shader's input. For more info, see Adding a pixel shader to a custom transform.

The following example shows the function used for a displacement map effect.

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

Requirements

Requirement Value
Header
D2d1effecthelpers.hlsli
DLL
D2d1.dll

See also

Effect Shader Linking

HLSL Helpers