Jump to content
  • Advertisement
Sign in to follow this  
qorthos

[SlimDX] Blending woes.

This topic is 2040 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 everyone,

 

I'm having trouble getting an edge detection shader to blend with the previously rendered image.

 

Quick background:

I render a GBuffer (color, normal depth)

I then render an image with just direct and ambient light values (to the 

Finally I use the normal and depth map from the GBuffer to create my edges.

 

Everything works fine when I render just the GBuffer and lighting.  I get this:

http://imgur.com/iPxkXJc,mBCTA9P,aVi7B6U#0

 

When I render just the edge detection shader I get this:

http://imgur.com/iPxkXJc,mBCTA9P,aVi7B6U#1

 

When I add in edge detection after the lighting render I get this:

http://imgur.com/iPxkXJc,mBCTA9P,aVi7B6U#2

 

I am stumped.  I don't think its actually a blending issue.  I set the BlendState on the shader with this:

 

BlendState SrcAlphaBlend
{
   BlendEnable[0]           = TRUE;
   SrcBlend                 = SRC_ALPHA;
   DestBlend                = INV_SRC_ALPHA;
   BlendOp                  = ADD;
   SrcBlendAlpha            = ONE;
   DestBlendAlpha           = ONE;
   BlendOpAlpha             = ADD;
   RenderTargetWriteMask[0] = 0x0F;
};

 

I have a DepthStencilView set when I do the GBuffer render, but not when I do the lighting and edge detection.

 

Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

Well, this one should have been a no-brainer.

 

The output from my gbuffer pass had all zeros in the alpha channels.  So when I set the blendstate to alpha on the edge detection shader my gbuffer started outputting completely transparent color.

 

Here's what it looks like all combined.

http://i.imgur.com/IoLPDPB.png

 

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!