Weird texture artifact

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
N.K.
Posts: 9
Joined: Sat Nov 06, 2010 12:42 pm

Weird texture artifact

Post by N.K. »

Hello all.

I've made a simple test scene, then loaded it to iwalktest, the irrb scene viewer, and I've noticed that the brick texture begins to tear when viewed from a specific angle.

Here's a screenshot:

Image

(Not really noticeable on the screenshot, but extremely ugly in real time.)

But then, I've noticed that this happens exactly the same way in Blender's textured view. So, it's not Irrlicht's fault (or if this is some kind of bug, it exist both in Irrlicht and Blender), but when I loaded the same scene in OpenSceneGraph's osgviewer, it was rendered perfectly. So, I've no idea what is this, or how to fix it, but it would be nice to find some kind of workaround.

(Yes, I've tried it with iwalktest in d3d mode, and although the textures were really ugly compared to the gl renderer, I didn't notice the tearing problem. But since OpenSceneGraph is an OpenGL only engine, and it renders the scene perfectly, I don't think that this is an OpenGL only issue, nor some kind of bug in the graphics driver, since this is the first time I've noticed this.)

Any idea about this?

Thanks in advance.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Try using Burning's renderer. If it's still incorrect, you should check your UV coordinates.
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

hm... sounds like a model format problem...

there could be bad duplication of vertices in the same spot...

try cleaning up any 'doubles' in your modeling program and then try saving in different formats (.obj, .3ds, .x etc.)

EDIT: please show us your wireframe.

also, what info can you give us on the model itself? how it was modeled, and with what program ?
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
N.K.
Posts: 9
Joined: Sat Nov 06, 2010 12:42 pm

Post by N.K. »

Thanks all for your help.

With Burning's software renderer, it looks alright.

The objects in this scene are in the .irrmesh format. The scene was made in Blender, and modelled from single-sided planes. And I've already removed all duplicate vertices.

Here's a screenshot using iwalktest in wireframe mode, showing one of the problematic sides, but I think it looks normal, each face is made of two polys, just the way they supposed to be:

Image

Edit: I've experimented with various file formats, with no success.
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

from what i can see it looks like you have an 'extreme' triangle on that little ledge...

EDIT: little trinagles with two veeeeeerryyy long sides and one very tiny side (like in your picture) could very well cause those artifacts. especially* in realtime rendering.
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
N.K.
Posts: 9
Joined: Sat Nov 06, 2010 12:42 pm

Post by N.K. »

It doesn't matter how long is the face, it will have this artifact when viewed from a specific angle. Even if I made the ledge out of elements with the size of one Blender grid unit.

And I've loaded the mesh to five different OpenGL-based modeller/model viewer applications, and OpenSceneGraph was the only one that was able to render it correctly, all the others had this problem, but in a kind of different way. In some of them, it was hardly noticeable, but in the most extreme case, the whole texture was messed up...

Then I thought it might be a driver issue, tried to revert to two older versions of the graphics driver. With all of them, the result was the same.

I know that ATI drivers generally have some issues with OpenGL, but I never noticed this before, and this is just a textured face, nothing special, so it should be alright for even the most outdated cards. Is something wrong with my GPU?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Since it's an angle problem you should enable anisotropic filtering. Also show us the texture (is it maybe just a very thin one, repeated in both directions?). Also check the texture wrap modes, ATI supports many different modes, maybe mirror would work here as well.
N.K.
Posts: 9
Joined: Sat Nov 06, 2010 12:42 pm

Post by N.K. »

Turning on anisotropic filtering doesn't seem to help. The texture is not thin at all, in fact, it's 700x700 pixels large, but I'm using only a thin part of it, since the ledge is short.

And how can I change between different texture wrap modes?
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

700x700 ain`t good dimension. It`s always a good habit to use textures that are POT - like 512x512.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
N.K.
Posts: 9
Joined: Sat Nov 06, 2010 12:42 pm

Post by N.K. »

Indeed, but I tried out a few different textures, most of them were power-of-two, with no success.

After all the experiments, I really suspect that this is some kind of hardware bug...

Edit: Okay, I give up. After looking closely, I noticed that this artifact is visible even in the sample apps bundled with Irrlicht, so it's indeed a hardware issue. Thank you very much everybody for your suggestions.
Post Reply