• Advertisement
Sign in to follow this  

SampleLevel and interpolation

This topic is 1431 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys

 

Are there any special requirements in the D3D setup for using SampleLevel multiple times in a pixel shader on the same texture? Eg say I want to sample 4 points around the current texture coordinate for an edge detection system. Anything special required on the D3D interface?

 

Thanks

JB

Share this post


Link to post
Share on other sites
Advertisement

Nope, nothing special required. It should work as expected. 

 

Also FYI if you need to sample in a fixed pattern, it can be helpful to make use of the integer offsets.

Share this post


Link to post
Share on other sites

// This will sample, and offset the sample position to the right two texels and down one texel
int2 offset = int2(2, 1);
float4 texSample = MyTexture.SampleLevel(MySampler, TexCoord, mipLevel, offset);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement