Results 1 to 11 of 11

Thread: Brain bender, part two: Motion blur.

  1. #1

    Thread Starter
    Lively Member Zero's Avatar
    Join Date
    Feb 2000
    Posts
    101

    Arrow 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

  2. #2
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    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...

  3. #3
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    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...

  4. #4

    Thread Starter
    Lively Member Zero's Avatar
    Join Date
    Feb 2000
    Posts
    101

    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

  5. #5
    Zaei
    Guest
    Something tells me this one ain't gonna fit on one disk...
    No VB6 app will...

    Z.

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    No VB6 app will...
    welllllll.... if you're zipping MSVBVM60.DLL and put your exe on the disk it will fit

    Erm.. 2 cents you know

  7. #7

    Thread Starter
    Lively Member Zero's Avatar
    Join Date
    Feb 2000
    Posts
    101

    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

  8. #8
    Fanatic Member
    Join Date
    May 2001
    Posts
    837
    from what i've heard, every image in a picturebox is converted to bitmap

  9. #9
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    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
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  10. #10

    Thread Starter
    Lively Member Zero's Avatar
    Join Date
    Feb 2000
    Posts
    101

    Sweet...

    Nope. They stay JPEGs. This changes everything... I just knocked my compiled EXE down from 2 megs to 312 KB.

    ~Zero the Inestimable

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
  •  



Click Here to Expand Forum to Full Width