Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualRobMaddison

Posted 27 February 2013 - 02:03 PM

Thought I'd start a new topic on this one. I'm having an issue rendering my screen layers.

My first layer, the game scene, is rendered to the back buffer, my next scene, the HUD (which currently is just a bunch of text quads), is rendered to a render target. I then blend the HUD render target onto the back buffer with a very simple full screen quad shader.

The problem is that my HUD render target doesn't appear to be fully transparent in the areas where I haven't drawn text. When I Clear the render target I clear it with 0,0,0,0 which I thought would give me a fully transparent surface. I then render my text quads to that target.

When I blend, the HUD layer just appears to cover the back buffer surface completely. If I adjust the alpha component in the output of the simple blend pixel shader to something like 0.5 then I get half brightness on the background and half brightness on the HUD layer.

Is there some special blend mode parameters I need to set for rendering alpha to rendertargets?

My blending is:

BlendOp=ADD;
SrcBlend=SRCALPHA;
DestBlend=INVSRCALPHA;
AlphaBlendEnable=TRUE;

This shader is very simple, renders to the back buffer and just takes a sample from the HUD layer.

#1RobMaddison

Posted 27 February 2013 - 01:58 PM

Thought I'd start a new topic on this one. I'm having an issue rendering my screen layers.

My first layer, the game scene, is rendered to the back buffer, my next scene, the HUD (which currently is just a bunch of text quads), is rendered to a render target. I then blend the HUD render target onto the back buffer with a very simple full screen quad shader.

The problem is that my HUD render target doesn't appear to be fully transparent in the areas where I haven't drawn text. When I Clear the render target I clear it with 0,0,0,0 which I thought would give me a fully transparent surface. I then render my text quads to that target.

When I blend, the HUD layer just appears to cover the back buffer surface completely. If I adjust the alpha component in the output of the simple blend pixel shader to something like 0.5 then I get half brightness on the background and half brightness on the HUD layer.

Is there some special blend mode parameters I need to set for rendering alpha to rendertargets?

PARTNERS