Blurring textures

Started by
1 comment, last by AndrewMack 22 years, 10 months ago
I''m making a project in 3D, using OpenGL, and I want the objects that are farther away to have blurred textures, kinda like a real persons vision. I''m sure there is a way to do this because I see it in all the flight sims I play. -thanks
Advertisement
Hey,

I''m not sure if this is exactly what you are looking for but my trusty book has a section on using the accumulation buffer for motion blur. Here''s some code it lists to help:

//draw the frameDrawFrame(0);//Load accum buff with 50% of frameglAccum(GL_LOAD, 0.5);//Draw the last 10 frames and accumulate 5% for eachfor (int i=0; i<10; i++){  DrawFrame(i);  glAccum(GL_ACCUM, 0.05);}//Display the final sceneglAccum(GL_RETURN, 1.0); 


Hope it at least interests you if it is not of use to you.

Regards,
David Stubbs
Regards,Dave
I think that you have in mind the effect of mipmapping. It works pretty easy in practice - if objects is farther away you use a smaller texture (ie 64x64 instead 256x256 and so on), those textures are either pregenerated by you or generated by hardware (it''s easy to notice in older games that as you move away from a wall/object the textures suddenly change quite a bit - a lower resolution mipmap is being used - try quake)
This way instead getting some weird results when trying to render a 256x256 texture onto a 5x5 pixels trinagle you end up with a nice blurred texture. Just refer to some mipmapping tuts, they should explain everything to you.
With best regards, Mirek Czerwiñski

This topic is closed to new replies.

Advertisement