Flickering edges in OpenGL

Started by
16 comments, last by NineYearCycle 16 years, 2 months ago
This is not the z-fighting problem we usually described.

It is probably because the edge is described by two different sets of vertices on the two side. And therefore, the faces on the left side and right side did not raster to give the same value along the edge. As shown in the image, the dots on the flickering edge appear as white. It is not possible caused by z-fighting as the left side and the right side are converging to the same color which is not white. Indeed, the dots are ceases, just like little holes on the wall. The white dots are the 3D scene behind the surface.

You can verify it easily. Try to paint the 3D scene behind the surface using red color, the dots should become red.

Beside, this problem is more obvious on ATI display card and less obvious on NVidia display card. Therefore, it may disappeared if you replace your display card.
Advertisement
Hi again, thnx for all the answers, I can't really say for sure whether it is Z-fighting or creases between polygons but the reason the pixels become white is, as ma_hty mentioned, due to the wall behind them (the vertical wall is actually intersecting the 45 degree ones).

Another picture, here with a ridiculously low near plane:
Image Hosted by ImageShack.us

As you can se, the edge in the screenshot is 'K'-shaped, where one column meets meets two wedge-shaped ones. The reason for building the map like this is that I can eaisly make the level in 2D with, say, MSpaint or something (think DOOM maps). Should I be considering merging all columns into one mesh (no idea how to do that) or can I make sure that the wedges connect somehow?

Quote:Original post by Mekanikles
As you can se, the edge in the screenshot is 'K'-shaped, where one column meets meets two wedge-shaped ones. The reason for building the map like this is that I can eaisly make the level in 2D with, say, MSpaint or something (think DOOM maps). Should I be considering merging all columns into one mesh (no idea how to do that) or can I make sure that the wedges connect somehow?


So basically you've got something like this made up of two seperate objects:

| |__/
| |_/
| |/
| |\

| |_\

| |__\


Where the double vertical lines on the left are one object and the angle ones are another?
In that picture it certainly looks like z-fighting caused by such an issue. Perhaps the correct answer is to get rid of the left-objects (pillar) polygons which are on the side that the tunnel section meets up against. Or to change the model of your tunnel to something like this:


| ||___/
| ||__/
| ||_/
| ||_\

| ||__\

| ||___\


Where you have a gap between the outermost angled "corner" of the tunnel and the pillar, then close it off with an outer side wall for the tunnel model?

Sorry if that's confusing I'm not very good with ASCII art.

As an aside what are you NEAR and FAR clipping planes currently set too? It looks like you can see quite a long way into the distance in that screenshot.

Andy

EDIT : if someone can tidy up those ASCII diagrams that'd great since I can figure out the combination of html + whatever_insanity_GD_uses that will get them to render properly :(

"Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile"

"Life is short, [the] craft long, opportunity fleeting, experiment treacherous, judgement difficult."

@NineYearCycle: You've got it spot on with your awesome ASCII-art, however, with the current implementation of the levels I cannot create thin walls.

I'm building levels almost just like in DOOM, with 2d-polygons with two values on each vertex. One lower and one upper bound, where a column is drawn in the shape of the polygon, sliced where the boundaries are. So, the whole map is built from different columns going from infinite negative to infinite positive with a segment cut out of them. Floors are just large columns where you are placed "inside" the gap. The only difference between this and DOOM is that I'm allowing tilted horizontal surfaces.

Curiosa aside, I think I've gotten the answers I needed. I will try to eliminate the walls that shouldn't be shown by discarding column sides that share 2 or more vertexes with an adjacent column. Or something like that anyway.

Thanx for all the replies /Mekanikles
Quote:Original post by Mekanikles
... The reason for building the map like this is that I can eaisly make the level in 2D with, say, MSpaint or something (think DOOM maps). ...


If this is the only reason, I think you should really consider whether it does make thing easier or not. Most well-designed 3D modeler software can give you 3D model without such problem with just a few click which can suit more situations. If what you are doing is not intuitively easier by a huge extend, what is the point of doing it?
the vertices have to be in exactly the same position
as Yann L saiz indexing the same vertice is ideal

have a look at this link also

http://www.google.com/search?q=t-junction+sparklies&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
@ma_hty, I know, I know, but this is an project assigment for a computer games course I'm taking and we're supposed to to the level building from scratch :-)

@zedz Thanx for putting a name to my problem!, I will certainly look it up some more.
Well you've got the option of fixing the T-junctions but most of those things that I read seemed to advocate avoiding them forming.

Couldn't you introduce a vertical component to the tunnel side sections like so

| | / | | /
| | / | | /
| |/ = | | | <- i.e. this part is flat now.
| |` | | |
| | ` | | `
| | ` | | `

That means that there's a gap between the flat wall of the other column.

Though this is of course the less technical solution to the problem ;)

Andy

EDIT - i give up with the ascii art on this forum :( I recommend cut n' pasting the above into notepad! :)

"Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile"

"Life is short, [the] craft long, opportunity fleeting, experiment treacherous, judgement difficult."

This topic is closed to new replies.

Advertisement