   Z-Buffer Transparency/Alpha Blending and PixelShader
  Hi guys, this is my first post, but ive been reading the foruns for a while now.Now straight to my problem (wich has been frustrating me for the past week).I'm making a space RTS (hw2 inspired) and ive been having some wierd graphics issues with my ship's engine trails hiding behind my selection circle, if you can see the picture you can notice the trail over the arrow hides behind transparent pixels of my celection circle. I draw the cicle using a simple pixel shader, and the trails are also pixel shaded.image -> http://img235.imageshack.us/img235/2496/bugf.jpgCurrently i have two theories:1. My pixel shadding is just wrong.2. My approach to drawing the transparent parts is wrongHere are bits of the code that i think are important:Trail PS:PS_Output PS(PS_Input input) {    PS_Output output = (PS_Output)0;output.Color = tex2D(TrailTextureSampler, input.TextureCoords) * input.Color;return output;}technique Base {pass Pass0 {ZEnable = true;AlphaBlendEnable = true;SrcBlend = SrcAlpha;DestBlend = InvSrcAlpha;CullMode = None;VertexShader = compile vs_3_0 VS();PixelShader = compile ps_3_0 PS();}}Selection circle PS:PS_Output mainPS(PS_Input input) {PS_Output output = (PS_Output)0;float val = pow(input.TextureCoords.x - .5, 2) + pow(input.TextureCoords.y - .5, 2);if (.25 - Width * 0.01 * (1/Size) < val && val < .25) {output.Color = float4(Color);} else {output.Color = float4(0,0, 0, 0);} return output;}technique Base {pass Pass0 {ZEnable = true;AlphaBlendEnable = true;   SrcBlend = SrcAlpha;   DestBlend = InvSrcAlpha;CullMode = None;VertexShader = compile vs_3_0 mainVS();PixelShader = compile ps_3_0 mainPS();}}Hopping for an answer to my nightmare.Thanks for reading anyway :)   
  I assume the selection object is actually a solid circle with a transparent texture applied?You usually disable Z-writes when rendering transparent geometry; otherwise the pixels will be written to the Z buffer even if the pixel is completely transparent - that'll cause the effect you're seeing.   ;Quote:Original post by Evil SteveI assume the selection object is actually a solid circle with a transparent texture applied?You usually disable Z-writes when rendering transparent geometry; otherwise the pixels will be written to the Z buffer even if the pixel is completely transparent - that'll cause the effect you're seeing.Worked like a charm :) Ithought about that solution too but it seemed too simple. Shame on me.   