Export (0) Print
Expand All

GetSamplePosition (DirectX HLSL Texture Object)

Gets the position of the specified sample.

ret Object.GetSamplePosition(

int s

);

 

Parameters

ItemDescription

Object

A Texture2DMS or a Texture2DMSArray texture-object type.

s

[in] The zero-based sample index.

 

Return Value

Returns the (x,y) sample position, a two-component floating-point vector.

Minimum Shader Model

This function is supported in the following shader models.

vs_4_0vs_4_11ps_4_0ps_4_11gs_4_0gs_4_11
xxx

 

  • Shader Model 4.1 is available in Direct3D 10.1 or higher.

Remarks

A pixel shader can be evaluated at sample frequency (run a pixel shader once per sample) or at pixel frequency (run a pixel shader once per pixel). Attach the SV_SampleIndex semantic to a pixel shader input to invoke a pixel shader at sample frequency, the input value is then used as a sample index when sampling the render target.

You can interpolate a pixel shader input in several ways. To interpolate at:

  • A pixel center, don't use any semantic.
  • A sample, use the SV_SampleIndex semantic.
  • A centroid location, use the _centroid modifier.

Related topics

Texture-Object

 

 

Community Additions

ADD
Show:
© 2014 Microsoft