Sign in to follow this  
sogetsu

Multiple Render Targets problem

Recommended Posts

I use the following code to render two texture: pd3dDevice->SetRenderTarget(0, surface0); pd3dDevice->SetRenderTarget(1, surface1); but it seem that the second texture have not been rendering.I check my adapter card's caps and sure it support this way(the NumSimultaneous is 4). And then what hell is the problem, help me!

Share this post


Link to post
Share on other sites
Quote:
Original post by Demus79

Hello,

Can you confirm that your shader code working properly ?

Cheers


In fact i am sure of that because the first texture has been rendered in a right way while the second has not. And the two texture are the same.

Share this post


Link to post
Share on other sites
Are you outputting 2 colour values inside your shader or just one?

I think I did something like this :



//Defined in the shader
struct lightmapOutput {
float4 oColour0 : COLOR0;
float4 oColour1 : COLOR1;
};

//In the pixel shader

OUT.oColour0 = colour0;
OUT.oColour1 = float4(1.0f, 1.0f, 1.0f, 1.0f);



You probably have done this, I'm just making sure you did :).

Also when I was writing my deferred renderer I have a few problems with stuff not being written to. I think I had to set each render target to NULL before rebinding them, but I can't remember exactly.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by weasalmongler
Are you outputting 2 colour values inside your shader or just one?

I think I did something like this :



//Defined in the shader
struct lightmapOutput {
float4 oColour0 : COLOR0;
float4 oColour1 : COLOR1;
};

//In the pixel shader

OUT.oColour0 = colour0;
OUT.oColour1 = float4(1.0f, 1.0f, 1.0f, 1.0f);



You probably have done this, I'm just making sure you did :).

Also when I was writing my deferred renderer I have a few problems with stuff not being written to. I think I had to set each render target to NULL before rebinding them, but I can't remember exactly.

Hope this helps.


What a fool i am! i forgot to output the second color!
Thank you very much for your help.
And forgive me for my asinine mistake!

Share this post


Link to post
Share on other sites

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