Skip to main content
gamedev.net
🔒 Locked

[java] 2D motion blur?

Started by wanner 0 replies 1.9k views
Original Post
wanner
wanner
Hi, i am making a little simple game and i want motion blur to get smoother animation. Im using regular java 2d graphics (Graphics2D), and active rendering following http://www.gamedev.net/reference/articles/article2418.asp. I wonder if anyone got some good tips on how to achive some nice motion blur effects when drawing my images, Other good tips for achieving smoother animations are also welcome :) Thank you
cignox1
cignox1
The only way that comes to my mind is by blitting the image more than once, each time translated in the direction of the movement with different alpha value:

first time: actual position (100% opaque)

second time actual position + direction * (delta * velocity)
(100 - (100/steps) opaque)

third time: second time position + direction * (delta * velocity)
(100 - (100/steps)*2 opaque)

and so on.

Delta could be tought as the movement in pixels for each time unit.
steps is the expected number of steps performed in this frame.
Note that this method may simulate motion blur only for straight movement: if the object rotates around itself, that wouldn't work...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.