8 bit textures in DX9

Started by
4 comments, last by RobM 10 years, 7 months ago

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

Advertisement

I used an 8 bit texture once with dx9, it had this format: D3DFMT_L8.

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.

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?

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.

clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

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

This topic is closed to new replies.

Advertisement