Direct3D 3D graphics over 2D sprites
In a Direct3D application I'm working开发者_JS百科 on I need to render a particle system (point sprites) over 2D sprite images. The 2D sprites are drawn using an LPD3DXSPRITE object with the Draw method. The particles are being draw in a 3D perspective and I need them to be overlayed on top of the 2D sprites. My problem is that the background sprite I'm rendering for the background of the game is covering the point sprites in the 3D perspective. If I remove the background image I can see the point sprites.
How can I go about having the point sprites on top of the background image? Thanks.
Turn off z writing (ZWRITEENABLE assuming you are using D3D9) draw the sprite. Then draw your particle system as normal (which may or may not involve enabling Z writing) and it will draw on top of the sprite.
精彩评论