Sign in to follow this  

multiple render targets problem

This topic is 4263 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 having a strange problem concerning multiple render targets. There are two different colors sent from the vertex shader to the fragment shader, but the fragment shader will only use one of the colors for both of the render targets. Also, there is a heavy drop in performance. The code works fine with Nvidia (with no drop in performance), it's only when I'm running it on ATI I have this problem. However I saw on another forum that someone had the same problem, but for him the code worked for ATI but not for Nvidia. Unfortunately no one had a good answer for it on that forum, hoping for better answers here :)... /Lena

Share this post


Link to post
Share on other sites
u mention 'multiple render targets'. which to me saiz rendering into say 2 textures or a texture + the framebuffer. but then u mention
'There are two different colors sent from the vertex shader to the fragment shader, but the fragment shader will only use one of the colors for both of the render targets. Also, there is a heavy drop in performance.'
which is something else so perhaps some code or better explanation

Share this post


Link to post
Share on other sites
Yep, I'm rendering to two different textures, that are both getting their color from my fragment shader that looks like below. For nvidia one texture is colored with the color from firstcolor and the second with the color from secondcolor, but for ati both textures get the same color as firstcolor...

struct vertexShaderOut
{
float4 color : TEXCOORD0;
float4 secondaryColor : TEXCOORD1;
};

struct pixelShaderOut
{
//Multiple Render Targets
float4 firstColor : COLOR0;
float4 secondColor : COLOR1;
};


pixelShaderOut main (vertexShaderOut IN/*, uniform float g, uniform float g2*/)
{
pixelShaderOut OUT;

/*Multiple Render Targets*/
OUT.firstColor.rgb = IN.color.rgb;
OUT.secondColor.rgb = IN.secondaryColor.rgb;

return OUT;
}

Share this post


Link to post
Share on other sites

This topic is 4263 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this