Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


A8_UNORM Texture sampling problem


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
3 replies to this topic

#1 BuraCULa   Members   -  Reputation: 105

Like
0Likes
Like

Posted 28 April 2012 - 04:48 AM

Hi. I have a texture with format A8_UNORM. When i try to sample it in pixel shader it was returning just zero.But when i changed my shader variable from
Texture2D<float> sth
to
Texture2D<float4> sth
and in shader, sampled the alpha component instead of the red component (sth.Sample(...).a instead of sth.Sample(...).r) it worked well.I am really confused with this situation. Although my texture has single channel,i am able to sample it with Texture2d<float4>.Can someone please enlighten me?

Sponsor:

#2 kubera   Members   -  Reputation: 946

Like
1Likes
Like

Posted 28 April 2012 - 10:30 AM

Please consider reading comments to the blog. There is an answer Posted Image
http://blogs.msdn.co...ple-update.aspx

#3 MJP   Moderators   -  Reputation: 11590

Like
1Likes
Like

Posted 28 April 2012 - 12:23 PM

The format dictates that that the data is in the alpha channel, not the red channel. So it makes sense that you have to ask for a float4 and use the alpha component, because if you asked for a single float you would get the red channel. You can always use R8_UNORM if you'd rather have the data in the red channel.

#4 BuraCULa   Members   -  Reputation: 105

Like
0Likes
Like

Posted 28 April 2012 - 05:18 PM

Hmm. So it seems i need to change my format to L8 and it is gonna be loaded as R8. Thank you. Posted Image




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