Jump to content

  • Log In with Google      Sign In   
  • Create Account

SampleLevel and interpolation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Naruto-kun   Members   -  Reputation: 338

Like
0Likes
Like

Posted 14 February 2014 - 08:55 AM

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



Sponsor:

#2 MJP   Moderators   -  Reputation: 11450

Like
1Likes
Like

Posted 14 February 2014 - 02:26 PM

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.



#3 Naruto-kun   Members   -  Reputation: 338

Like
0Likes
Like

Posted 16 February 2014 - 01:25 AM

Thanks. How does one make use of integer offsets then?



#4 MJP   Moderators   -  Reputation: 11450

Like
1Likes
Like

Posted 16 February 2014 - 02:08 PM

// 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);


#5 Naruto-kun   Members   -  Reputation: 338

Like
0Likes
Like

Posted 17 February 2014 - 02:30 AM

aha. Thanks a bunch






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS