Jump to content
  • Advertisement
Sign in to follow this  
Naruto-kun

SampleLevel and interpolation

This topic is 2075 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!