HLSL question
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]
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement