Radial blurring?
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
Radial blurring?
I tried to find it at wikipedia and google with no luck (kept finding photoshop tutorials). Does anybody know the math/process behind radial blur? Are you just rendering a scene and distorting the framebuffer (almost like anti aliasing)?
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
Maybe it has another name, or you don't know it by that term. Here's a screenshot of what some guy did (Dreamcast too).
http://yam.20to4.net/dreamcast/index_old.html
http://yam.20to4.net/dreamcast/index_old.html
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
-
- DC Developer
- Posts: 80
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Sweden
- Has thanked: 0
- Been thanked: 1 time
There are several ways to do radial blur. For simplicity I am going to ignore pure "render to texture" stuff and go with the two ways that are similar to how I usually do it:
1:
a) render scene
b) copy frame buffer to texture
c) draw this texture to the scene with alpha < 1 and scale > 1
d) draw this texture to the scene with alpha less than previous step and scale more than previous step
e) repeat d several times until desired effect is reached
Good: Always gives the same blur effect no matter what your framerate is
Bad: lots of overdraw == expensive!
2:
a) render scene
b) render overlay texture with scale > 1 and alpha < 1
c) copy framebuffer to overlay texture
d) repeat
As you render more and more frames, the overlay texture gets more and more blurred. The bad part with this is that on a low framerate you get a "feedback" effect, but on a high framerate it looks very nice and is very cheap since you only draw one transparent overlay each frame.
1:
a) render scene
b) copy frame buffer to texture
c) draw this texture to the scene with alpha < 1 and scale > 1
d) draw this texture to the scene with alpha less than previous step and scale more than previous step
e) repeat d several times until desired effect is reached
Good: Always gives the same blur effect no matter what your framerate is
Bad: lots of overdraw == expensive!
2:
a) render scene
b) render overlay texture with scale > 1 and alpha < 1
c) copy framebuffer to overlay texture
d) repeat
As you render more and more frames, the overlay texture gets more and more blurred. The bad part with this is that on a low framerate you get a "feedback" effect, but on a high framerate it looks very nice and is very cheap since you only draw one transparent overlay each frame.
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
-
- DC Developer
- Posts: 80
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Sweden
- Has thanked: 0
- Been thanked: 1 time
On dc I just rendered the same object several times a la version 1 as I described below. So you have:
a) render object
b) render object with alpha < 1 and scale > 1
c) render again with alpha less than previous step and scale > previous step
d) repeat c until satisfied
Expensive as hell because of all the overdraw/blending, but it works.
a) render object
b) render object with alpha < 1 and scale > 1
c) render again with alpha less than previous step and scale > previous step
d) repeat c until satisfied
Expensive as hell because of all the overdraw/blending, but it works.
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
- Stef.D
- DCEmu Respected
- Posts: 114
- Joined: Wed Oct 15, 2003 1:46 am
- Has thanked: 0
- Been thanked: 0
- Contact:
That would be really cool.BlueCrab wrote:Hopefully after the next few weeks, I'll have time to figure out how to fix that support.... Right now classwork at the university's kinda overwhelming me.Stef.D wrote:Looks really interesting
Can you do render to texture on dreamcast ?
Render to texture open the door for many neat render effects.
I hope we can do it without trick (as render to FB and copy FB back to texture)
- BlueCrab
- The Crabby Overlord
- Posts: 5666
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Ok, I got a little bit of time to sit and hack around with render to texture support, and I'm happy to report that I got it working. I haven't had a chance to adequately test it yet (i.e. in the case that you're using DMA to do all the primitive transfers), but it does work with what KOS gives you in the default setup.
I'll probably commit what I've worked out to the KOS subversion repository either tonight or tomorrow (including a small example of how to use it).
I'll probably commit what I've worked out to the KOS subversion repository either tonight or tomorrow (including a small example of how to use it).
- JS Lemming
- Insane DCEmu
- Posts: 202
- Joined: Mon Apr 04, 2005 8:08 am
- Location: C:\CON\CON
- Has thanked: 0
- Been thanked: 0
- Contact:
- BlueCrab
- The Crabby Overlord
- Posts: 5666
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Well, upon further tests, I've found that what I have so far needs some work. I basically tried to do a radial blur effect using the texture, but it failed miserably. I know that I have gotten it set up properly (as I can dump the generated texture out to an image file, and it looks like it should), but because of the odd way I hooked it in the rendering code, it won't work in its current form for a radial blur effect....
I have an idea of how to fix it, which I will attempt to implement in the morning.
I have an idea of how to fix it, which I will attempt to implement in the morning.
- BlueCrab
- The Crabby Overlord
- Posts: 5666
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Exactly how it works.... basically, when you want to do a render to a texture, instead of callingStef.D wrote:Nice to heard you got it working, great job man
How did you basically do it ?
I mean, can you render to a texture in one pass ?
I guess we can probably render a scene to a squared sized frame buffer then use that frame buffer as a texture... something like that ?
Code: Select all
pvr_scene_begin();
Code: Select all
pvr_scene_begin_txr(texture, &texture_width, &texture_height);
The only problem is, the way that the PVR code is set up in KOS, you have to draw do a few more frames before you can count on the texture being correct. As I said, I'm trying to figure out a good way to fix this problem, but I haven't gotten it quite yet.
- Stef.D
- DCEmu Respected
- Posts: 114
- Joined: Wed Oct 15, 2003 1:46 am
- Has thanked: 0
- Been thanked: 0
- Contact:
Does that pvr_scene_begin_txr is available in the KOS library ?BlueCrab wrote:Exactly how it works.... basically, when you want to do a render to a texture, instead of callingStef.D wrote:Nice to heard you got it working, great job man
How did you basically do it ?
I mean, can you render to a texture in one pass ?
I guess we can probably render a scene to a squared sized frame buffer then use that frame buffer as a texture... something like that ?you do something like this:Code: Select all
pvr_scene_begin();
Right now, the texture_width and texture_height have to be 1024 and 512 respectively, but eventually, I'll get that problem fixed, so that they can be adjusted as necessary (and the function will adjust them on its own).Code: Select all
pvr_scene_begin_txr(texture, &texture_width, &texture_height);
The only problem is, the way that the PVR code is set up in KOS, you have to draw do a few more frames before you can count on the texture being correct. As I said, I'm trying to figure out a good way to fix this problem, but I haven't gotten it quite yet.
or you wrote it ?
Is the overhead very expensive for now ?
Keep us informed about your progress, it's something very interesting
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 81 times
- Been thanked: 64 times
- Contact:
- BlueCrab
- The Crabby Overlord
- Posts: 5666
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Ok, if you want to play around with rendering to a texture, I just committed the code. Also, there's an example of how to use it in http://svn.allusion.net/svn/kos/kos/exa ... ender/ta.c
Enjoy.
Enjoy.