Blurring of distant objects/textures?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Shizuka-Konmei
Posts: 11
Joined: Tue Feb 02, 2010 1:03 am

Blurring of distant objects/textures?

Post by Shizuka-Konmei »

I wasn't exactly sure what to title the thread, so I just tried to describe the problem. You can pretty much see what is going on the picture I've included. It seems that when I am a certain distance from a wall in this Quake 2 map, it attempts to blur the texture and what not. You can see that that there is a strip that separates the unblurred and successfully blurred parts. It appears that the texture is jumbled in this strip. As I move about the the level, the strip follows in front. When I render with OpenGL, the problem is less apparent as the strip is but a line, but it's not occurring far enough away to seem natural.

Image

I didn't include another picture, but the problem is more apparent when looking at object like the wooden windows. When this strip appears over such parts of the level, the object is completely covered by either black or texture that looks like the surrounding wall.

So does anyone know if this a problem with the rendering device, lighting, hardware, or something else? I tried looking a bit, but I was rather unsure of how to go about it. Thanks in advance.
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Just disable MIPMAPS

driver->setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false);
Shizuka-Konmei
Posts: 11
Joined: Tue Feb 02, 2010 1:03 am

Post by Shizuka-Konmei »

Thanks for such a quick reply. That worked wonderfully. Is there any particular reason this occurs? I always figured mipmaps were generally desired.
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Textures creation speeds up with mip maps.
I think this is the main reason.

But without mipmaps looks better.

You could enable and disable this option for needed objects
Shizuka-Konmei
Posts: 11
Joined: Tue Feb 02, 2010 1:03 am

Post by Shizuka-Konmei »

Alright. That sounds good for now, then. I'll experiment with it more in the future once I've finished learning the tutorials.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

Texture creation is *slower* with mip-maps, because it has to create several sizes of the texture.

They are used for 2 reasons; first, distant objects can use smaller textures, speeding up the rendering (I believe. I could be wrong about this one). and second, they remove the classic rendering artefacts of high-frequency lines. Having an image of bars far away from the camera makes strange patterns appear depending on the way the texture pixels happen to coincide with the screen pixels. But with mip-maps the texture is pre-aliased preventing these appearing. Also things look eerily sharp in the background without it.

For you they seem to be taking effect far too close to the camera. Either a bug or incorrect setting I guess. Possibly Irrlicht chose something based on your hardware. Unfortunately I can't help with a solution; I only know how to change the setting inside shaders (something I wouldn't recommend unless you're already using them because it will slow the render down). the API may help - this is most likely in IVideoDriver, IrrlichtDevice, ITexture or ISceneManager.

If you don't find an answer there, hopefully somebody else can point you in the right direction, but I advise against turning mipmaps off entirely (except some special cases)
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

You can set the lod bias of a texture layer from a material:

Code: Select all

material.TextureLayer[0].LODBias = 5.0f
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I'd suggest to update your video drivers, and make sure that your gfx card settings are not set to something unusual. This is, make sure you have the sliders on the "nice rendering" side.
Shizuka-Konmei
Posts: 11
Joined: Tue Feb 02, 2010 1:03 am

Post by Shizuka-Konmei »

hybrid wrote:I'd suggest to update your video drivers, and make sure that your gfx card settings are not set to something unusual. This is, make sure you have the sliders on the "nice rendering" side.
My drivers are updated. I doubled checked the settings once mipmaps were suspected and I didn't really notice any difference. I'll try playing with it again, but I'm not terribly concerned with it at the moment.
Post Reply