Archived

This topic is now archived and is closed to further replies.

AndrewMack

Blurring textures

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 frame
DrawFrame(0);
//Load accum buff with 50% of frame
glAccum(GL_LOAD, 0.5);

//Draw the last 10 frames and accumulate 5% for each
for (int i=0; i<10; i++)
{
DrawFrame(i);
glAccum(GL_ACCUM, 0.05);
}
//Display the final scene
glAccum(GL_RETURN, 1.0);


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

Regards,
David Stubbs

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites