![]() |
| | #1 |
| Confused Join Date: Sep 2001 Location: Sweden
Posts: 3,122
| D3DXSprite and alpha blend
__________________ MagosX.com Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. |
| Magos is offline | |
| | #2 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| Yes, since alpha blending is set using SetRenderState(). If you set alpha blending prior to D3DXSprite render calls, it is possible, although improbable that D3DXSprite will turn it off after the call. Direct3D is a pure state machine in that any state you set lasts until you 'un-set' it. This is why you should turn alpha on, render all alpha objects, and then turn it off. This guarantees that render states won't be 'left over' in future calls. You can also use state blocks to control render states. You think alpha blending is bad wait until you try using SetTextureStageState(). Those states are also left as-is in the next render so you must reset them to what you want prior to rendering your next object. DirectX 10's non-FFP will solve most of this issue and shader's for DX9 already address this. For now look into Direct3D render state blocks and effects. Last edited by Bubba; 05-23-2006 at 04:57 AM. |
| Bubba is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|