Blurry lines between further away tiles

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
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Blurry lines between further away tiles

Post by barakatx2 »

Image

I am making a class that generates scene nodes from a 3D array to make map out of cubes like in the screenshot. The problem is the further tiles have blurry lines between them. Anyone know why this would happen?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Are your different tile textures all in one texture? If so, mip mapping tends to blend the colors of the tiles together, leading to things like this.
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

In this screenshot they are all using the same texture. Can I turn off the blending?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Have you tried clamping the UV coordinates?
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

Is that done like this?

Code: Select all

node->getMaterial(0).TextureLayer[0].TextureWrapU = video::ETC_CLAMP;
node->getMaterial(0).TextureLayer[0].TextureWrapV = video::ETC_CLAMP;
I tried all three clamp types. It didn't change anything. (Thanks for all the help so far though!)
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Yes, that would be how it's done. Besides that, I don't know what the issue could be. Sorry... if I think of anything I'll let you know.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Clamping only avoids wrapping on the edges, this is due to blurring within the texture itself for mipmaps. Pretty much your choices are to use separate textures, or have the tiles use a smaller portion of their part of the texture so blending doesn't effect it.
barakatx2
Posts: 14
Joined: Tue Aug 24, 2010 7:00 am

Post by barakatx2 »

Wouldn't turning off mimmaps like this

driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);

fix the problem then? I called that before I create the textures and it didn't change anything :/

EDIT: nevermind, I turned off the flag from the start of the generate terrain code and turned it back on at the end and it worked. there are no more blurry lines! is this supposed to affect performance? thank you for the help
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

It increases the fill time a lot for distant triangles, because it samples pixels that are pointless for an object so far away. But if it's working for you and there's no noticeable decrease in speed, it should be ok.
onlinebingo
Posts: 1
Joined: Tue Sep 28, 2010 3:02 pm

Post by onlinebingo »

I have located the file, but dont know how to reach it. If I open my text editor Editplus as Administrator I can browse to c:usersall usersflashfxp and see the file there. But I havent figured out how to browse to the same folder using windows explorer, when I do, I cant see the folder "All users".I can see both hidden files/folders as well as system files.
Post Reply