D2DGetScenePosition function

Returns the value of the input SCENE_POSITION. Only available when D2D_REQUIRES_SCENE_POSITION is declared in the source file.

Syntax

float4 WINAPI D2DGetScenePosition(void);

Parameters

This function has no parameters.

Return value

The function returns a float4 in the format SCENE_POSITION.

Remarks

The following example shows the use of the function in generating a dissolve pattern.

D2D_PS_ENTRY(BlendDissolve)  
{  
    min16float4 dest   = D2DGetInput(0);  
    min16float4 source = D2DGetInput(1);  
  
    min16float4 color = dest;  
  
    if ((source.a > 0.0) && (source.a >= Rand((min16float2)D2DGetScenePosition().xy)))  
    {  
        // TODO: perform  dissovlve math
    }  
  
    return color;  
}  

Requirements

Requirement Value
Header
D2d1effecthelpers.hlsli
DLL
D2d1.dll

See also

Effect Shader Linking

HLSL Helpers