D2DGetScenePosition 函式

傳回輸入SCENE_POSITION的值。 只有在原始程式檔中宣告D2D_REQUIRES_SCENE_POSITION時才可使用。

語法

float4 WINAPI D2DGetScenePosition(void);

參數

此函式沒有參數。

傳回值

函式會以 SCENE_POSITION 格式傳回 float4

備註

下列範例示範如何在產生氣氣模式時使用 函式。

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  dissolve math
    }  
  
    return color;  
}  

規格需求

需求
標頭
D2d1effecthelpers.hlsli
DLL
D2d1.dll

另請參閱

效果著色器連結

HLSL 協助程式