I'm trying to figure out how to do nice-looking motion blur. Right now I have a hack that involves maintaining a list of canvases and fading them out over each frame, but that's more of a trail than actual motion blur and it looks bad when objects are moving at high speeds.
Most of the research I've done indicates that for actual motion blur you need to compare the model-view matrix of the previous frame to the current frame, but I'm not aware of any way to access this information in LOVE. There's probably some kind of simplifying assumption I'm missing since we're working in 2D but I'm stumped. Has anyone looked into this before?
Per-Pixel Motion Blur
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Sir_Silver
- Party member
- Posts: 286
- Joined: Mon Aug 22, 2016 2:25 pm
- Contact:
Re: Per-Pixel Motion Blur
Have you looked into/know what a shader is at all? Post processing effects, like motion blur, are usually done through the use of shaders.
I personally haven't tried to replicate motion blur with shaders (I always turn the effect off in games because it's dizzying and distracting), however a quick google search for "motion blur shader love2d" yielded this result
https://love2d.org/forums/viewtopic.php?t=77170
I personally haven't tried to replicate motion blur with shaders (I always turn the effect off in games because it's dizzying and distracting), however a quick google search for "motion blur shader love2d" yielded this result
https://love2d.org/forums/viewtopic.php?t=77170
- thatcosmonaut
- Prole
- Posts: 9
- Joined: Sun Nov 06, 2016 6:04 pm
Re: Per-Pixel Motion Blur
Yeah I'm familiar with shaders, I've written a few for this project.
I'm trying to implement the technique detailed in this post: http://john-chapman-graphics.blogspot.c ... s-are.html
But I'm running into a wall. Particularly the part regarding sending model-view matrices to the shader.
I'm trying to implement the technique detailed in this post: http://john-chapman-graphics.blogspot.c ... s-are.html
But I'm running into a wall. Particularly the part regarding sending model-view matrices to the shader.
Re: Per-Pixel Motion Blur
The matrix is already in the shader by default. For 2d you can go simpler than that however. You make a normal blur shader that uses a blur map. Then you just make a blur map that would produce appropriate looking blur. Using two color channels in the map you can encode both magnitude and direction of blur, in vector form. Channel x encodes magnitude for x, and channel y for y, and direction apparently emerges from applying both simultaneously.
- thatcosmonaut
- Prole
- Posts: 9
- Joined: Sun Nov 06, 2016 6:04 pm
Re: Per-Pixel Motion Blur
Thanks, I think that makes sense. I'll give it a try.
Who is online
Users browsing this forum: No registered users and 3 guests