Jump to content
  • Advertisement
Sign in to follow this  

AlphaBlending and MultiPass Shader

This topic is 2770 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've got a little probleme with AlphaBlending. My simplified scene is composed by a textured quad, and an outlined polygon (that's the problem :) )

First, I call draw to display a textured Quad

Then, I've got a second call to Draw using an other effect with 2 pass.
First pass draw the expended polygon with (1,0,0,1) as color
The second Pass draw the original polygon with (1, 0, 0, 0.6)

So, basically, I would like to to draw a semi-transparent polygon with an opaque outline, and I want to see my texture beyond.

Is that possible ?
In my 2nd pass, can i access to the pixel color before the first pass ?

Here are my shaders ...

technique PositionNormal
pass Outline
VertexShader = compile vs_3_0 OutlineVS();
PixelShader = compile ps_3_0 OutlinePS();
AlphaBlendEnable = TRUE;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
BlendOp = Add;
pass Inner
VertexShader = compile vs_3_0 VS();
PixelShader = compile ps_3_0 PS();
AlphaBlendEnable = TRUE;
SrcBlend = SrcAlpha;
DestBlend = InvDestAlpha;
BlendOp = 4;


Thanks in advance

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!