Wrong texture displaying

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
lenchis001
Posts: 17
Joined: Sun Sep 18, 2016 5:44 pm
Location: Belarus, Grodno

Wrong texture displaying

Post by lenchis001 »

Hello, everyone. I have little scene with road mesh. As you can see, displaying is wrong (image texture has lines). Question: what is it and how can i remove it?

Thank you.

Image
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Wrong texture displaying

Post by CuteAlien »

Looks like z-fighting to me. Likely you have 2 polygons very close together so they share the same depth-value (depth-buffer usually has only 8 bits so you get 256 different depth-values only). Raise one polygon slightly. A common trick used in games for roads is for example to add sidewalks - that makes it easier to hide that the road is raised above the landscape. You can also try to reduce z-fighting by using a closer near-plane (the depth-buffer resolutions depends on the ratio or distance between near and far-plane), but generally better to solve it by better geometry.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply