Re: [long] Graphical glitch with tiles



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
.



Relevant Pages

  • Re: How can I draw faster than .NET graphics?
    ... as strange as it may look, converting my images to bmp made the fps go from ... the framework load the file each time it draws?!? ... if I draw only one of the two images I get 6-8 FPS... ... draws with no transparancy. ...
    (microsoft.public.dotnet.framework.drawing)
  • How do I prevent multiple connections when drawing dynamic images?
    ... I have an ASP.NET page that draws over 32 dynamic images using an HttpModule ... Since IIS under Win2K Pro has a limit of 10 ... connections, some of the images do not get drawn because it appears that the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Polar Plot.vi
    ... The polar plot vi draws two images, the grid and the actual plot by using a vi called draw multiple lines.  Unfortunately, the function that draws the polar plot only allows for a single color, as shown in the image below: ...
    (comp.lang.labview)
  • Re: pdflatex includegraphics bounding box [ without the image ]
    ... using includegraphics. ... does not include the images but just draws the bounding box of the ... with the images included. ...
    (comp.text.tex)