Advertisement

Blurring the background

Started by July 10, 2001 08:23 PM
5 comments, last by Dave the Embalmer 23 years, 7 months ago
Does anyone know a quick way to blur a background? In my case, a starfield. I''ve noticed that in a lot of games when you rotate, the starfield blurs. I haven''t tried the accumulation buffer, but I hear it would be quite slow for this sort of thing. Remember, I only want to blur the background (a gaint skybox). -Dave
well if its just some "gaint skybox", couldnt you blur the image/s used in some pain program. Otherwise, maybe you could incrment/dec. the texture coordinate''s by extreme values? I dont know how that would work, but its worth a shot.
masterghttp:/masterg.andyc.org
Advertisement
I think it''s like motion blur. I don''t know how to do this for objects, but since you only want a background image blurred, I can guess how to do it.

I don''t know if there is a ''proper'' way to do it, but this is how I would.

Store the image''s positions etc for the past x frames (or perhaps, for x frames evenly spread over the past y seconds, which will keep the blurring effect constant for people with different fps''s). Then mix them so that the most recent is brightest, the next most recent is a little darker, and so on, until the oldest is really dark. When you add them together, it should have a blur effect.

Hope this helped.
I don''t think this is the type of blurring you are refering to but just enable your linear mag texture filtering and reduce the size of the texture. That will blur it but won''t give the star trails you are referring to. The OpenGL superbible has some stuff on the accumulation buffer, but ive never done it. you could try drawing the frame again and offset the view angle slightly. But your frame rate would go through the floor....

FatalXC
how about don''t clear the screen each frame but instead have the skybox texture have like 95% alpha value.

life is unfair, take advantage of it.
UNMB2 - if the link doesn''t work, try clicking it
life is unfair, take advantage of it.UNMB2 - if the link doesn't work, try clicking it :)
Thanks guys! I''m somewhat new to OpenGL, so I need one last bit of help. Is there an easy way to set a textures alpha within OpenGL? And the very last thing (for now }=) ) is how could I change a textures brightness within OpenGL without going out into a graphics program and manually making several textures of several brightnesses.

-Dave
Advertisement
The Alpha value can be controlled by using glColor4f (R,G,B,Alha);

For the brightness stuff you could set the color up or down as you want it (1,1,1 -> Bright white | 0.5, 0.5, 0.5 -> Grey | etc.

To make them really bright you could blend a quad on the whole screen using the alpha blending described above!!

That would make something like a whitefade!! It''s really cool!!

Play around a little with this...and everything will become much clearer!!!

Hope this can help you out a little bit!!

Take Care!
http://home.no.net/cybertux
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]

This topic is closed to new replies.

Advertisement