Jump to content
  • Advertisement
Sign in to follow this  
g0nzo

HLSL question

This topic is 4451 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 converting an image from RGB to Yxy color space in pixel shader. I need to store Yxy values in one texture (so I can later convert back to RGB) and Y value only in another texture. Is it possible to do it in a single pass or do I have to convert to Yxy first and then just copy Y value in another pass? One more thing: does pixel shader always have to return float4? Even if I'm rendering to single channel texture? [Edited by - g0nzo on October 3, 2006 4:57:36 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by g0nzo
Hi,

I'm converting an image from RGB to Yxy color space in pixel shader. I need to store Yxy values in one texture (so I can later convert back to RGB) and Y value only in another texture. Is it possible to do it in a single pass or do I have to convert to Yxy first and then just copy Y value in another pass?

One more thing: does pixel shader always have to return float4? Even if I'm rendering to single channel texture?


u can render to multiple textures at the same time (see MRT in the dx doc), this way u can store Yxy at the same time as just Y. But the most GPUs have the restriction to use the same size per pixel on each of the set textures, so if u use R8G8B8A8, u have to use R8G8B8A8, R16G16 or R32 as the second texture.

u can return whatever u want to, the compile will handle it the correct way, but the hardware uses float4 only.

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!