Jump to content
  • Advertisement
Sign in to follow this  
afsajghfd

alpha blending surface

This topic is 3335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was trying to put a surface in front of another surface to do alpha blending. To put the surface in front, I was using StretchRectangle wich I recently discover that it doesn't care about the alpha channel :( I create the front surface format as A8R8G8B8, I do Present.Clear (of the front surface) using Color.FromArgb(0, 0, 0, 0) I'm not using textures to fill the surfaces, only real-time rendering it's possible to do this ? Any ANY help is welcome, i'm really stuck here Thanks !

Share this post


Link to post
Share on other sites
Advertisement
If you want to use hardware alpha-blending, then you need to create a texture (not just a surface) and draw geometry that samples that texture. ID3DXSprite makes this very easy to do, it will let you draw a texture at location in screen space.

Share this post


Link to post
Share on other sites
You can create a render target texture by calling IDirect3DDevice9::CreateTexture and passing D3DUSAGE_RENDERTARGET. Then to render to that texture, get the top-level surface using IDirect3DTexture9::GetSurfaceLevel.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!