Re: [long] Graphical glitch with tiles
- From: "Phil Frisbie, Jr." <phil@xxxxxxxxxxxx>
- Date: Tue, 04 Oct 2005 21:24:23 GMT
none wrote:
Hello all,
I'm a bit of a newbie, so bear with me. I'm trying to write an app that is somewhat similar to a jigsaw game.
Basically, I want to put pieces of smaller images on a larger image. Unfortunately, there are graphical flaws in the rendering that make my program useless.
Here is a (much) simplified version of my program. It actually draws a white box, and it draws another smaller white box on top of the large one.
Normally, I should see only white, right ? Nope, I can see flickering gray lines on the top and the bottom.
That is commonly called 'z-fighting'.
Look at the XXX in the program. I tried changing 0.0f into 0.1f and tx into (tx-0.1f), and it removed the flaw. It worked, but in the real program, it distorts the texture so much that it is not really a solution.
I tried GL_CLAMP_TO_EDGE but to no avail.
Does anyone have an idea on this one?
Without going into along explanation, you have several options.
The first is to not draw one large white box, but draw a grid of white boxes that matches you tiles. By using the same EXACT same corner vertices you will stop the z-fighting.
Another option is to turn off the z-buffer.
Another is to use the decal offset extension.
Yes, basically this is a decaling issue, so if you search on this you will find many techniques.
-- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com .
- References:
- [long] Graphical glitch with tiles
- From: @(none)
- [long] Graphical glitch with tiles
- Prev by Date: Re: [long] Graphical glitch with tiles
- Next by Date: Re: A camera and a texture
- Previous by thread: Re: [long] Graphical glitch with tiles
- Next by thread: Re: [long] Graphical glitch with tiles
- Index(es):
Relevant Pages
|