Jump to content
  • Advertisement
Sign in to follow this  
ff8

Blur

This topic is 4826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello everyone i want to make simple blur ,how can i do it ? i googled for this but i didn't find any good one :P bye

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Well, if I were to explain all your choices here I would finish writing yet another book on the subject.

Blur operations are a kind of image filtering operation.

The usual (but not unique) way of doing these filtering operations is as a weighed average.

For each pixel at position (x,y) in your destination image, you take the pixels at and around that position in your source image, multiply the numbers that specify their colour by a factor (not necesarily the same for all these pixels), and add all these values to produce the output pixel.

Of course, the trick is in knowing how much pixels around the destination to take, and what the factors should be.

For example, To make it simple, you could take the pixels at (x-1,y), (x+1, y), (x,y), (x,y-1), (x,y+1) and multiply all of them by (1/5). This way, you are producing an image that's the average of all those pixels, and that will create a blur effect. Not necesarily the kind of blur you may want and certainly not the "best".

How to choose these factors (how many pixels around, and which factors to use) will create a whole lot of possibilities.

Probably, searching for "gaussian blur" will give you a more complex, higher quality blur to think about.

Share this post


Link to post
Share on other sites
i am sorry but i still don't understand it :( i search for it but i can't get it :'(
can anyone give me simple code for this effect ?
bye

Share this post


Link to post
Share on other sites
I want pure blur not motion blur :P.
I think NeHe's tutorial was about motion blur .
bye

Share this post


Link to post
Share on other sites
An easy way to do it: render the scene, copy it to a texture, clear the colour buffer, then render the texture using trilinear filtering.

A harder and *much* slower way: render the scene, copy it to a texture, copy the texture data to a buffer, create a buffer with an equal size, iterate over the entire image adding up the values for the new pixels using some number of pixels around the current one, as well as the current one, and dividing the total by the number of pixels in the sum, then use glDrawPixels to draw the blurred result.

The first way is easy, and a lot faster, but the second lets you choose exactly how blurred the final result is, but you shouldn't use it if you need your app running in realtime. ;)

Share this post


Link to post
Share on other sites
There are several ways to perform blur as some of the gentlemen above have pointed out. Before I provide any source code, tell me something; what is your target graphic hardware?

Share this post


Link to post
Share on other sites
Thank you all for your replies,
Quote:

There are several ways to perform blur as some of the gentlemen above have pointed out. Before I provide any source code, tell me something; what is your target graphic hardware?

My grapic card is ATI X600 XT.
I hope to see your code :D.

Quote:

A harder and *much* slower way: render the scene, copy it to a texture, copy the texture data to a buffer, create a buffer with an equal size, iterate over the entire image adding up the values for the new pixels using some number of pixels around the current one, as well as the current one, and dividing the total by the number of pixels in the sum, then use glDrawPixels to draw the blurred result.

Can you explain it more ?if you don't mind .

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!