Advertisement Jump to content
Sign in to follow this  
Endemoniada

Alpha Channel as Storage Problem

This topic is 1860 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 guys,

 

I'm having a problem using the alpha channel as a storage container:

 

// shader to store the data
float4 pshader(VS_OUTPUT input) : COLOR
{
 // store some data
 return float4(a,b,c,d);
}
 
// shader to display it (for testing purposes)
float4 pshader(float2 uv : TEXCOORD) : COLOR
{
 // show data 'd' from above as grayscale image
 return float4(tex2D(Sampler0,uv).www,1);
}

 

It doesn't display the proper data.

 

Thanks.

 

Share this post


Link to post
Share on other sites
Advertisement

What format is your render target? Does it contain an alpha channel?

What alpha blending settings are you using for your "shader to store the data"?

Share this post


Link to post
Share on other sites

There can be an error in so many things that you didn't show us...

You are in fact doing two things (complex things) - you store some information in the alpha channel and then you have some testing code to display it. Maybe the important code (storing the value) works and just the testing code is wrong? You can easily verify this by using PIX or other similar debugger. You'll quickly see what does your render target's alpha channel contain after the first step.

 

Btw, saying "It doesn't display the proper data." on a technical forum is just a little bit better than "It doesn't work."

It is better because we at least know that it's not crashing. But we still don't know what do you see.

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!