• Advertisement
Sign in to follow this  

8 bit textures in DX9

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

 

I'm trying to create an 8 bit texture using D3DFMT_P8 and I'm getting an error which is basically that it's an invalid format.  Is this the only available 8 bit texture for use with SM3.0?  I only need 8 bits and I need to do a tex2D on it in my shader.

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement
P8 is for 8 Bit texture with palette, which is unlikely to be supported on modern GPUs. As the previous poster said, you want L8. L stands for luminance.

Share this post


Link to post
Share on other sites

P8 is for 8 Bit texture with palette, which is unlikely to be supported on modern GPUs. As the previous poster said, you want L8. L stands for luminance.

 

Thanks - can I still use the standard tex2d with that type?  It returns a float4 so would it just return a float instead?

Share this post


Link to post
Share on other sites

Yes, your value just lives in the red/'x' component of the value. I think some GPUs will actually splat it across the vector, too, but don't quote me on that.

Share this post


Link to post
Share on other sites

Yes, your value just lives in the red/'x' component of the value. I think some GPUs will actually splat it across the vector, too, but don't quote me on that.


Got it working, thanks

Share this post


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

  • Advertisement