# Advice on multiple-image alpha blending

This topic is 3430 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
33
2. 2
3. 3
4. 4
5. 5

• 9
• 13
• 85
• 11
• 10
• ### Forum Statistics

• Total Topics
632969
• Total Posts
3009599
• ### Who's Online (See full list)

There are no registered users currently online

×
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1937715709209442, "perplexity": 1701.104137930656}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-43/segments/1539583513760.4/warc/CC-MAIN-20181021052235-20181021073735-00017.warc.gz"}