Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SampleLevel and interpolation

4: Adsense

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   

442
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



#2 MJP   Moderators   

19455
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   

442
Like
0Likes
Like

Posted 16 February 2014 - 01:25 AM

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



#4 MJP   Moderators   

19455
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   

442
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.