|
-
Jun 7th, 2001, 05:41 AM
#1
Thread Starter
Lively Member
Brain bender, part two: Motion blur.
Alright, rocket scientists. For an effect in a game I'm writing I want to use a motion blur effect on a bitmap. I'd also like it to be done on the fly, so I don't need to carry around 400 640x480 bitmaps with my program.
I was thinking of an effect similar to the motion blur in PC Paintbrush or Corel PhotoPaint. All of these effects are on a straight black background, so we don't need to worry about blending in backgrounds or sprite transparencies.
Something tells me I'm going to do a lot of pixel plinking here. Does anyone know a good algorithm, or does anyone know of a site that deals with this sort of thing?
Thanks,
~Zero the Inestimable
-
Jun 7th, 2001, 05:54 AM
#2
PowerPoster
Couldn't you use BitBlt and paint the image a couple of pixels offset using one of the operators (vbsrcwibble etc)
Whatever you're going to do - it's going to be slow...
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Jun 7th, 2001, 08:13 AM
#3
Addicted Member
Depends on how real you want it
You might be able to get away with drawing the image tice, overlapping them mostly, so you get the image echo, then Drawing a standard Motion Blur Image, An Image with Black Lines graded into white, with white being transparent.
If you apply a mask to get the black lines then apply the mask of the Image your coping it over you should get a nice motion blur effect.
Some Days, i just get this feeling that i'm helping to write dozens of Viruses...
-
Jun 7th, 2001, 11:39 AM
#4
Thread Starter
Lively Member
Hmm...
I should write a DLL with an API call that uses the parameter "VbSrcWibble"... I don't know what it would do, though.
I did a bunch of research on the web today. The results were not promising. I think I'm just going to limit myself to 30 frames and use a whole bunch o' prerendered JPEGs for my effects. I only need to blur three things ("Title", "How To Play", and "Game Over") so I might be able to get away with it.
Something tells me this one ain't gonna fit on one disk...
~Zero the Inestimable
-
Jun 7th, 2001, 12:26 PM
#5
Something tells me this one ain't gonna fit on one disk...
No VB6 app will...
Z.
-
Jun 7th, 2001, 01:22 PM
#6
-
Jun 7th, 2001, 08:21 PM
#7
Thread Starter
Lively Member
Cursed runtimes...
I use VB 5. Yeah, I know, I'm primitive.
I usually keep the application on one disk and then hand out SFX archives of the VB5 runtimes as needed. I can stuff all of the runtimes (including various OCX files) on one disk if I use a RAR archive. I also provide a link to a download for the runtimes in the documentation. So far the system has worked...
I actually managed to stuff Gen and the VB5 runtimes on one disk once. Don't ask me how, though.
Hey, here's another one: If I use Jpegs instead of bitmaps in a picturebox and compile the application, do the Jpegs take up less space than the same images as bitmaps would, or does stupid VB just convert them to bitmaps anyway?
~Zero the Inestimable
-
Jun 7th, 2001, 08:54 PM
#8
Fanatic Member
from what i've heard, every image in a picturebox is converted to bitmap
-
Jun 8th, 2001, 10:14 AM
#9
Frenzied Member
Well, to make motion blur, all you need to do is blt the object at another position, and then blend it with the front DC (or surface or whatever) each frame. That's how they do it.
I made a module with functions for this a while ago... you'll find it at http://161.58.186.97/showthread.php?s=&threadid=71234
-
Jun 13th, 2001, 03:50 PM
#10
Thread Starter
Lively Member
Sweet...
Nope. They stay JPEGs. This changes everything... I just knocked my compiled EXE down from 2 megs to 312 KB.
~Zero the Inestimable
-
Jun 13th, 2001, 05:14 PM
#11
transcendental analytic
operating a jpeg in memory is much slower than with bitmaps.
i think motion blur is done by looping and keep adding to a carrying variable and then multiplying it with a motion blur index and then finally assigning carry to current pixel.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|