Crappy striated textures

Started by
9 comments, last by TheProphet 20 years, 8 months ago
Hello, I have a texture problem. I have written a tool and there are some textures problems like this one : http://dgk.free.fr/ss0000.jpg http://dgk.free.fr/ss0001.jpg I think it is not really a problem, but just some bad options in OpenGL. Could someone help me ?
Advertisement
First guess: z-fighting. Make sure two polygons aren''t overlapping.
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Yes, that is the case.
But how could I fix it ? I guess I should change the depth buffer precision, but I don''t know how...
It''s probably Z fighting. You have two polygons that are close in depth and the resolution of your z buffer is too low, making z testing a bit iffy.

Try increasing the resolution of the z buffer by either increasing the number of bits allocated to it or by reducing the ratio of your far plane to near plane (i.e. decrease the far plane or increase the near plane) to see if it disappears.
Well, I have tried to pu the near plane far from the eye, and get the far plane closer. But the problem is still present...
Are the overlapping polygons facing the same direction ?
Or are they representing both sides of the cloth ?

You could try to enable back (or front if you prefer) face culling in this case.
Modifying the depth buffer parameter will only workaround the problem. Artifacts will still show on low-end/old gfx cards (TNT2...).
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Enabling bacface culling with
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
solves the problem (not entirely since I lose some information, but no matter for the moment).
I think it will be the solution I will buy

Effectively, changing the depth of the zbuffer will only workaround the problem - I have tried.

Thanks
Why do you use glFrontFace ? CCW is the default value, n''est-ce pas ?
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Oui, biensûr, mais je la change à un autre endroit dans le programme.

Yes, of course, but I change it in another function in the program.
Why do you change the front face definition instead of choosing to cull front or back faces depending on the context ? ;*)
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)

This topic is closed to new replies.

Advertisement