# Advice on multiple-image alpha blending

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

## Recommended Posts

Hey all.. First off, let me say that I have googled this but am currently looking for some advice on a best approach to solve my problem. Basically what I'm attempting to do is conceptually pretty simple but I haven't worked with DirectX in many years.. sadly. I am writing my program in vb.net or c#.. Okay, so here is the problem. I am attempting to composite a series of five fullscreen images with per-pixel alpha blending (RGBA image files) to one monitor, and a second set of five fullscreen RGBA images to a second monitor. Initially I tried GDI+ which was easy, but sucked pretty hard at getting more than 8FPS on my machine for both monitors. The problem is that I need to hit a target of 30FPS. (so 30FPS on both monitors) I am thinking that a solution that would get the 30FPS might involve either direct3d (billboards?) or the directshow video mixing renderer ? At this point I'm looking for some advice on an approach that would work so any assistance would be appreciated. Any useful URLs would also be appreciated.. ;) - Michael Tanczos

##### Share on other sites
Quote:
 Original post by Michael TanczosHey all.. First off, let me say that I have googled this but am currently looking for some advice on a best approach to solve my problem. Basically what I'm attempting to do is conceptually pretty simple but I haven't worked with DirectX in many years.. sadly. I am writing my program in vb.net or c#..Okay, so here is the problem. I am attempting to composite a series of five fullscreen images with per-pixel alpha blending (RGBA image files) to one monitor, and a second set of five fullscreen RGBA images to a second monitor. Initially I tried GDI+ which was easy, but sucked pretty hard at getting more than 8FPS on my machine for both monitors. The problem is that I need to hit a target of 30FPS. (so 30FPS on both monitors)I am thinking that a solution that would get the 30FPS might involve either direct3d (billboards?) or the directshow video mixing renderer ? At this point I'm looking for some advice on an approach that would work so any assistance would be appreciated. Any useful URLs would also be appreciated.. ;)- Michael Tanczos

The performance with GDI+ are quite predictable, it is not hardware accelerated.
The DirectShow Video Mixing Renderer (VMR) actually use a DirectDraw Surface (for VMR7) or a Direct3D9 Surface (for VMR9) under wraps so its basically the same as using DirectX.
I recommend the use of Direct3D9/10 with SlimDX as wrapper, 30 FPS is a very low target and should be achievable with any discrete card in circulation (and almost any integrated card as well) for a simple calculation like the one you have to do.

If you have no experience in DirectX, but have the time to learn I recommend to search the internet for basic guides about using textured quads and blending techniques. (Starting with DirectX10 is better, because it is the base over the future DirectX versions will be build on (DirectX11 for example is very similiar)). After you've done a little experience with that you can try to work your way out with multiple render targets and multiple swapchains (i think using 2 swapchain on the same device is the best idea in this simple situation, but if you want you can use 2 different devices is good too)

If you have no experience in DirectX, and no time to learn try to search for an high level engine to have a solid base to start on. (even thought I doubt there will be any for SlimDX and C#.)

Obviously if you have any problem with DirectX post on these forums and we'll try to be of help. :D

##### Share on other sites
It sounds like you'd be able to use ID3DXSprite with Direct3D to render your images. No need to worry about billboarding or any transforms, just create a couple of swap chains for each window and use ID3DXSprite::Draw() to handle painting.

##### Share on other sites
Thanks for the help guys.. this saved me tons of effort trying to figure out what in the DirectX arsenal would be appropriate to use. I utilized a combination of both of your answers. For the directX wrapper I used SlimDX and am using sprites inside of SlimDX. However, I'm not sure of how SlimDX can handle swap chains.. I can't seem to find anything in the docs about it. Although for the multiple monitors the sets of composited images will both be entirely different and won't require any shared resources between the two in terms of textures.

Just for a heads up, I'm building a downstream keyer to key graphics over live video through a video mixer board. This should hopefully work, as all I need to do is genlock the analog vga signals to a black burst reference signal and feed that into the keyer inputs of the mixer board. I could fork over a couple grand for a keyer, but instead I spent $89 on a scan converter with genlock capabilities and am trying to write my own software. I'll let you know how things progress. - Michael Tanczos #### Share this post ##### Link to post ##### Share on other sites Quote:  Original post by Michael TanczosThanks for the help guys.. this saved me tons of effort trying to figure out what in the DirectX arsenal would be appropriate to use. I utilized a combination of both of your answers. For the directX wrapper I used SlimDX and am using sprites inside of SlimDX. However, I'm not sure of how SlimDX can handle swap chains.. I can't seem to find anything in the docs about it. Although for the multiple monitors the sets of composited images will both be entirely different and won't require any shared resources between the two in terms of textures.Just for a heads up, I'm building a downstream keyer to key graphics over live video through a video mixer board. This should hopefully work, as all I need to do is genlock the analog vga signals to a black burst reference signal and feed that into the keyer inputs of the mixer board. I could fork over a couple grand for a keyer, but instead I spent$89 on a scan converter with genlock capabilities and am trying to write my own software.I'll let you know how things progress.- Michael Tanczos

In SlimDX when you create a SwapChain class in DX9 it actually calls the CreateAdditionalSwapChain.
Remember that DX9 supports only one fullscreen swapchain per device. If you need the two swapchains to be fullscreen you need to use multiple devices. (I suggest to use multiple devices, as you said there are no resources shared)

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 9
• 9
• 46
• 41
• ### Forum Statistics

• Total Topics
631751
• Total Posts
3002076
×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!