• Advertisement
Sign in to follow this  

hlsl texture Sample result?

This topic is 2074 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

i have a texture with a DXGI_FORMAT_A8_UNORM format. in hlsl:

float4 color = tex.Sample(sample_state, Texcoord.xy);

then i got the color with a correct alpha channel result and the each r/g/b channel result of 0.

is there any way to get other specified rgb result, when the texture's DXGI_FORMAT has no rgb channel component? thx

Share this post


Link to post
Share on other sites
Advertisement
There's no way to specify the value that you get for channels that aren't present in the texture. In fact I don't think the documentation even specifies what the value should be, so I don' t know if you could even rely on it being 0 on all hardware.

Share this post


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

  • Advertisement