Jump to content
  • Advertisement
Sign in to follow this  
sogetsu

Multiple Render Targets problem

This topic is 4574 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 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
Advertisement
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
Does the debug runtime report any problem?

Have you checked it with RefRast?

If you don’t mind some parts of your shader code could be useful too.

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
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!