Ultra fast drawing in dotnet

Initial tests show that GDI + (writing to VB.NET) is not enough for my purposes. My application should be able to draw tens of thousands of particles (colored circles, very preferably smoothed) in full screen resolution at a speed of 20 frames per second.

I hesitate to move away from GDI +, as I also need many other advanced drawing functions (dashes, images, text, paths, fills) of GDI +.

Look for good tips on using OpenGL, DirectX, or other platforms to speed up particle rendering from VB.NET. My application is strictly 2D.

Goodwill David

+4
source share
7 answers

If you want to use VB.NET, you can go with XNA or SlimDX.

I have experience creating games with GDI + and XNA, and I can understand that GDI + is giving you problems. If I, wherever you check XNA, is much faster than GDI +, because it really uses your graphics card to draw, and it has a lot of good documentation and examples on the Internet.

SlimDX also looks good, but I have no experience with it. SlimDX is basically the DirectX API for .NET.

+3
source

The only way to get the required speed is to refuse from rendering software to hardware rendering ... and, unfortunately, this means switching to OpenGL or DirectX.

An alternative is to try and optimize your graphics routines only for drawing particles to be drawn, and not for the entire screen / window.

I would agree with JaredPar that you should profile first to determine if you can improve your existing code base before making a huge transition to the new structure. DirectX is not the easiest structure if you are not familiar with it.

+3
source

Perhaps the problem is with your algorithm, not with GDI +. Profiling is the only way to know for sure. Without a profile, it is very possible that you switch to a new graphical shell and run into the same problems.

If you made a profile, what part of GDI + was causing the problem?

+2
source

The most significant increase in speed that I found while writing a game creator using GDI + was to convert my bitmaps to Format32bppPArgb; -

SuperFastBitmap = ConvertImagePixelFormat (SlowBitmap, Imaging.PixelFormat.Format32bppPArgb)

If they are no longer in this format, you will immediately see the difference when converting.

+2
source

As Jared said, perhaps a significant portion of your cycles are not part of the GDI, and you can reduce them.

An easy way to find this is to randomly stop it several times and examine the stack. The chance that you will catch him as a result of wasting time is equal to half the time wasted.

Any instruction or call command that appears on more than one such pattern is that if you can replace it, you will see acceleration.

In general, the method is as follows:

+2
source

How do you work in VB.net, have you tried using WPF (part of .net with 3.0)? Since WPF is based on DirectX, not GDI +, this should give you the speed you need, although WPF development is not straightforward.

+1
source

Since GDI + does not move with the graphics card, it slowly renders because it uses the CPU for rendering. At least you can use DirectX or SlimDX.

(sorry for bad english)


See this: http://msdn.microsoft.com/en-us/library/windows/desktop/ff729480%28v=vs.85%29.aspx http://www.codeproject.com/Articles/159586/Starting- DirectX-with-Visual-Basic-NET

0
source

All Articles