Rendering to D3DFMT_G16R16F

Started by
1 comment, last by Koiby25 15 years, 3 months ago
I'm trying to render to a texture of format D3DFMT_G16R16F, but I'm not really sure what I should output from the pixel shader. Everything works fine with a D3DFMT_A8R8G8B8 texture when I output a float4, but I tried returning a float2 with G16R16F and got an error when it compiled (error X4529: COLOR0 must be a four-component vector). Should I be using a float4 and just filling the first two components, or something else?
Advertisement
A pixel shader must always return a float4. If you're rendering to a D3DFMT_G16R16F, the B and A channels will be discarded. So, yes, just return a float4 with the G and R channels filled.
NextWar: The Quest for Earth available now for Windows Phone 7.
Sounds good. Thanks!

This topic is closed to new replies.

Advertisement