   Proper way to do multipass alpha blending
  I currently have some transparent faces that are rendered through multiple shader passes; however, this is preventing the faces from properly alpha blending with what's behind them. It appears that during the first pass, the face is alpha blended with the background, which, to my knowledge, makes blending the rest of the passes pretty much impossible.What's the proper way to go about doing this? I would think it would be to somehow completely render the face with all of its passes, and then alpha blend it. I've tried rendering the alpha faces to a separate render target... but of course, they just end up blending with the black background, so it doesn't work. Also, I've tried blending my subsequent passes according to destalpha, but that appears to always be zero. So, I'm a bit stumped.   
  What is the material? What are the passes? Is the object meant to be opaque or partially transparent?   ;  There's no material set (the shaders don't take the material into account anyway). The first two passes basically handle the lighting (lightmap and point lights), and the last pass just blends the face texture with the result of the first two passes.And yeah, the object is meant to be transparent. This method works perfectly if the object is opaque, but it just doesn't blend properly with the background if it's transparent.   ;Quote:There's no material set (the shaders don't take the material into account anyway).No, no. I mean literally, what is the material? Skin, metal, plastic...?Quote:The first two passes basically handle the lighting (lightmap and point lights), and the last pass just blends the face texture with the result of the first two passes.Sounds like that should be pretty easy to make into a single-pass technique. Why the multiple passes?The only way I can think of to accomplish this is to carry out the passes for each object before moving to the next object. That'll kill your performance if you're drawing a lot of objects with the same technique, though.   ;  The reason there's multiple passes is for the dynamic lights. I haven't gotten good results picking the best 8 lights or whatever, since the lights are set per group, rather than per face, and leaving out even one light can sometimes dramatically impact the appearance of a lift or whatever. So, doing multiple passes lets me take the cap off, and lets the user cap it if he or she wishes. I used to have everything in one massive shader, but I wasn't getting very good performance out of the card I was using at the time.And I already am completely rendering one alpha face at a time before moving onto the next one. It still doesn't work :(I'm trying to render a bunch of different "materials": glass, water, etc.   ;  It sounds like you're almost there.  What you want to do is set your background to transparent black and not opaque black.  Then you'll need to make sure that your intermediate render targets have an alpha channel so that you can properly compose the whole thing together.   ;  Alright, so I went ahead and re-implemented the method of rendering my alpha objects to another texture, and then drawing that texture over the whole screen after all the alpha faces have been rendered. The problem I'm having with this method is that when I render the full-screen alpha texture, for some reason, the alpha faces look like they've been blended with the black background. The texture itself looks perfectly fine - the faces are the correct brightness, and the texture is transparent everywhere a face hasn't been drawn. However, when I draw the texture containing the rendered contents of the alpha faces, they all become a lot darker for some reason, which really bewilders me. When I draw the full-screen quad, I'm using invsrcalpha/srcalpha for srcblend/destblend respectively.If any of this is confusing, I can post screen shots.Any idea what's up with that?EDIT: Whoops! I solved it! I still had the lightmap texture bound, so that was screwing with it! Oh silly me. Anyway, thanks for all your help! :D   