Advertisement Jump to content
Sign in to follow this  
Koiby25

Rendering to D3DFMT_G16R16F

This topic is 3658 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'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?

Share this post


Link to post
Share on other sites
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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!