Sprite Transparency on Render Target

Started by
1 comment, last by Namethatnobodyelsetook 16 years, 1 month ago
I'm working on a render engine that is based on a post processing architecture. Recently I've made the addition of 2D rendering using the ID3DXSprite interface. The problem is that when I render sprites onto a render target that isn't the backbuffer, none of the alpha blending works correctly. I've tested the same code with post processing disabled, rendering directly to the backbuffer and it works perfectly. When I've viewed it in PIX it appears that the sprite is copying its alpha data directly onto the render target, rather than blending its color. Does anybody know a solution for this? I could just write my own sprite library and render them using shaders so that I have total control, but I would prefer the simplicity and speed of using ID3DXSprite.
Advertisement
I figured out how to get transparency working, although I'm not completely sure why it's working now.

It didn't actually have anything to do with ID3DXSprite, and the backbuffer had no significance. In my setup for post processing I had been setting all four render targets every frame and when I reduced it to only the first, everything worked perfectly. Since that's the only one I'm using at the moment it doesn't cause any problems for me, but I'm still a bit unsure about this solution.

If anybody knows why this fixed it I'd be very curious to find out.
D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING

This topic is closed to new replies.

Advertisement