pouët.net

Memorable radial blur you've seen(not just demos)

category: general [glöplog]
BB Image
Instant Rubber Johnny! \o/
And after the conversion, the blur makes sense. But then again, doesn't all radial blur make sense when you convert it to cartesian coordinates?

Polar<->Cartesian
Zooming blur<->vertical blur
Rotating blur<->horizontal blur
added on the 2008-01-21 16:17:48 by nitro2k01 nitro2k01
nitro: As ryg pointed out, zooming blur is still zooming blur in polar coordinates. It just becomes 1D instead of 2D.
added on the 2008-01-21 16:23:04 by doomdoom doomdoom
(x,y) € R^2, (r, theta) € R^2
Both are 2D!

...the math thingy again. :)
added on the 2008-01-21 16:38:05 by xernobyl xernobyl
Quote:
hm yes, but if you just additive blend the several zoomed copies then you get a clamp (0..1) for every pair of images you add. If you do the sum in a pixel shader then you can get over 1 which will then be properly normalized at the end !


you don't do an additive blend then multiply down afterwards, you do a weighted sum in each pass, and if you do it the way I explained, all the passes have unit gain. in the code I posted, the "Itemp = ..." stuff is what happens in the pixel shader, or you can even do it completely without pixelshader if you want; the 4-step variant can be implemented with good quality even using just doubletexturing. you need to compute (a*Img0 + b*Img1 + c*Img2 + d*Img3), a+b+c+d=1. draw 2 fullscreen quads. first one does a lerp(r,Img0,Img1) with r=a/(a+b) and gets drawn without alphablending, second pass does a lerp(s,Img2,Img3) with s=c/(c+d) and writes t=c+d into the alpha. that one gets drawn with (srcalpha,1-srcalpha) blending. even with 1.x pixel shaders, evaluating the convex combination with 3 lerps usually gives better results than using 1 mul+3 multiply-adds: it tends to distribute the rounding error better, so you don't usually get banding.

Quote:
(all these zoomed copies anyway should be pre-'blurred', doing a radial blur/jypnoglow on the high res image will look cheap and slow)

if it looks cheap without blurring first, you're either not using enough taps, or you're victim to roundoff error, or both. that's why i recommend the iterative method. it's numerically rock-solid (even when implemented with 8-bit blend units) and it gives you the equivalent results of a lot of samples at negligible cost. 3 steps with 4 samples each are the equivalent of 64 samples/pixel, which would be damn expensive if you did them directly in the pixel shader. 2 steps later, you're at the equivalent of 1024 samples/pixel, which is downright impractical.

really, it's no rocket science. here are two screenshots done with the wz3 radial blur (which dates back from candytron, uses only doubletexturing and not even the 3-lerp trick, so the blend precision isn't that great).

source image (1024x512):
BB Image
and the blurred version (parameters+performance in image):
BB Image
added on the 2008-01-21 16:40:08 by ryg ryg
ryg: for someone from FARBRAUSCH you clearly dont use enough colors!
Quote:
(x,y) € R^2, (r, theta) € R^2
Both are 2D!

...the math thingy again. :)
Polar coordinates as such is of course 2D, but the blur algorithm operates only in 1D, since it only cares about either only the r axis or only the theta axis.
added on the 2008-01-21 16:54:07 by nitro2k01 nitro2k01
so what. even implemented the direct way and in cartesian coordinates, radial blur is a 1d blur. you may need to do bilinear filtering to access the samples, but that only means somewhat higher per-pixel overhead.
added on the 2008-01-21 17:02:46 by ryg ryg
ryg, might be a dumb question, but are all those copies done at the full resolution of the screen?
ok I think we are on the same line here. My comment about adding and blending was directed towards whoever suggested this (and maybe none did, as I didn't read carefully the posts before).

However.

How did the do the hypnoglow/radial blur in 'liveevil' (the part with the text). Is it something completely different ?
added on the 2008-01-21 17:06:12 by Navis Navis
pete, for this particular shot, yes. normally, when you use THAT high zoom, you can typically switch to a lower resolution rendertarget after the first (or maybe second) pass because it doesn't make a visible difference anyway.
added on the 2008-01-21 17:10:45 by ryg ryg
oops, sorry, the z=1.16 in the shot is wrong, it's actually more like z=1.05. in the wz3 version, what you enter is the zoom of the final copy, not the zoom per step, and i did the conversion incorrectly :)
added on the 2008-01-21 17:15:18 by ryg ryg
BB Image
added on the 2008-01-21 19:10:18 by neoneye neoneye
BB Image
:/
BB Image

Yeah baby!
added on the 2008-01-21 20:14:12 by doomdoom doomdoom
thanx you Doom, his anus looks almost normal now :D
added on the 2008-01-21 20:20:00 by Zest Zest
I'd say Burra / aardbei. And may be Viagra / mewlers for volumetric radial blur.
added on the 2008-01-21 20:59:49 by spite spite
Lord Graga: ask me again in a couple of days...
added on the 2008-01-22 10:40:50 by kusma kusma
kek.
Lord Graga: here you go
added on the 2008-01-22 23:28:23 by kusma kusma
Danke, pretty decent CPU usage!
ryg - first of all, thanks for taking your time with the detailed explanations!

And this is all well and good, but we don't really want to do radial-blur, now do we. We want to blur "outwards", because you can actually use it for something other than messing up the image.

BB Image

- as far as I can tell, this is not possible using the iterative version of the algorithm. Which is sad, as it is way faster.

Doing cartesian->polar you should be able to blur "in one direction", which should work - still singlepass-blur.

Finally, using the navis-asd-pixelshader-suggestion, you're able to not only have more control of the sampling, but also gives you control of the weight of each sample depending on the distance. which is nice.
added on the 2008-01-23 11:04:44 by hornet hornet
hornet: ryg already described what you want (which is rather "zoom blur" than "radial blur" in Photoshop parlance). Anyway, both effects are closely related and if you implement one of them using ryg's method, the other one is just as simple to do.
However, judging from the examples, what you *really* want is:
1. Use any standard zoom blur algorithm.
2. Move the center of the zoom.
3. Blend the blurred image with the original one.
4. Profit.
added on the 2008-01-23 11:31:56 by KeyJ KeyJ
Oh, sorry if I didn't read the posts thoroughly enough... I'll look at the zoom-part more closely, to see why I'm wrong :) I'll probably still argue for the "more control in the pixel-weighing"-part.

I'm aware of the four-step-moving-center-method-to-profit zoomblur :)
added on the 2008-01-23 11:53:47 by hornet hornet
keyj, no offense intended, but for a split second i thought it was solo2 describing the animated gif. the adundance of "5. no music" made me see the difference.
added on the 2008-01-23 12:26:20 by skrebbel skrebbel
^^ haha..
added on the 2008-01-23 12:28:11 by Navis Navis

login