Radial zoom blur around a point

Started by
3 comments, last by LlamaGuy 20 years, 3 months ago
I''m having some problems perfecting this effect... I can get a radial blur around the center of my viewport, but I need it to be around a certain point. I''ve got the back buffer in a texture and I''m ready to draw, but I can''t figure out the math. In case you''re wondering what it''s for, I''m trying to get a cool effect for a special attack in my game. Basiclly it''s a black hole gun and I want a radial blur around the black hole whereever it is on screen. I''m using gluProject so I know the screen XY coordinates of the blackhole.
Advertisement
I''m intrested in seeing how this turns out, please post a screenshot when your done.

What the problem is when you scale the captured render, its scaled around the center.

+------------+| +--------+ || | +----+ | || | |    | | || | +----+ | || +--------+ |+------------+ 


Instead of capturing the whole screen you need to capture an area centered around your object, and when you draw them they need to be centered around your object.

I''m not sure how to go about it, but i''ll give it some thought.
Yeah, I was thinking that when I render my scene I would need to render with that point centered on screen. My program is so damn modular I can pull it easily too. I''m just trying to figure out what to do with it then. Right now I''m just coding in other parts of the game waiting for something to hit me.
Ok, I think I got a decent looking blur... what I did was capture the screen like normal, then when I draw the blur quad it was twice as big as the screen with about 50 pixels extra on either side. Then with each pass of the for loop I translate over depending on the blur's X and Y position. If the blur goes offscreen, I slowly subtract from the for loop so the user doesn't see the edges of the blur's texture. It could be better but this was all I could get. If you want to see it in action:

www.llamaguy.com/untitled.jpg

It looks really cool when it's moving.

[edited by - LlamaGuy on January 11, 2004 8:17:13 PM]
Yeah thats bascily what I came up with, glad you got it working.

This topic is closed to new replies.

Advertisement