Re: Efficient visualization of pixmaps
- From: Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
- Date: Sat, 18 Jul 2009 06:26:37 +0100
Peter Duniho wrote:
On Fri, 17 Jul 2009 18:42:35 -0700, Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
wrote:
The ray tracing aspect is certainly demanding but it requires a huge
amount
of computation just to get the color of a single pixel. Hence I was
amazed
to see that Microsoft's pixel setting routines were the bottleneck of my
entire app. [...]
How are you trying to set the pixel? Are you using the Bitmap.SetPixel()
method?
I was, yes.
If so, then sure...that's very slow. So, don't do that.
Again, without a code example it's impossible to provide any good,
specific advice. But, most likely what you need to be doing is getting a
buffer of the bitmap data and accessing it directly. Your own code not
only has enough information to do that best without having to go through
all the same machinations that Bitmap.SetPixel() does, you avoid
unnecessary transitions between your client code and the OS's lower
layers.
That can achieve 15fps here. Unless there is anything better, that will have
to do.
Stop blaming the tools, just because you don't yet know all the best ways
to use them. I doubt that it is literally impossible for you to rendering
the results of your ray-tracing as quickly as you're able to compute them.
I can do it with XNA, just not with WinForms or WPF. Apparently Silverlight
is much worse still...
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
.
- Follow-Ups:
- Re: Efficient visualization of pixmaps
- From: Peter Duniho
- Re: Efficient visualization of pixmaps
- References:
- Efficient visualization of pixmaps
- From: Jon Harrop
- Re: Efficient visualization of pixmaps
- From: Tom Dacon
- Re: Efficient visualization of pixmaps
- From: Jon Harrop
- Re: Efficient visualization of pixmaps
- From: Peter Duniho
- Efficient visualization of pixmaps
- Prev by Date: Re: Efficient visualization of pixmaps
- Next by Date: Re: Efficient visualization of pixmaps
- Previous by thread: Re: Efficient visualization of pixmaps
- Next by thread: Re: Efficient visualization of pixmaps
- Index(es):
Relevant Pages
|