Sorting problems with GLRenderer

Started by rolz, February 14, 2006, 10:52:54 AM

Previous topic - Next topic

rolz

Helge, i've noticed a bug with overlaping non-transparent objects:

There are two overlapping non-transparent objects with diffent sortOffset. When the camera moves, overlapping is not consistent, e.g. on one frame the object 1 is on top, and on another object 2 is on top.

The problem appears to be in 1.10_pre_xx , with GLRenderer only. When i switch back to 1.9 and AWTGLRenderer the problem goes away.
Regards,
Andrei

EgonOlsen

Quote from: "rolz"
The problem appears to be in 1.10_pre_xx , with GLRenderer only. When i switch back to 1.9 and AWTGLRenderer the problem goes away.
Must be a coincidence...the sortOffset is only an offset for sorting, not for rendering. None-transparent objects are sorted by state/textures, not by depth. Adding a sort offset to them is possible and it will be evaluated (i.e. added to their state sort value) but it's rather pointless and it will in no way influence the rendered image, because the zbuffer determines what is visible and what not, not the sorting order. Sounds more like a z buffer issue/inaccuracy to me, which may occur if two of these objects share the same space or are at least very close to each other. Do you have screen shot of this?

rolz

#2
Sure, here is the screenshot:
*Removed*

I've just noticed that the problem occurs only in fullscreen.
Object are not very close to each other (though their X is the same, but Y differs). Actually as you can see on the movie, they are 2 pieces of the wall with a small overlapping area. I've played around with Config.glZbufferDepth but with no results.
Regards,
Andrei

rolz

Woops, i would like to take back my statements about fullscreen mode only - the problem appears also in windowed mode
Regards,
Andrei

EgonOlsen

Ah, that one...you have this problem in the older AWTGLRenderer version too. I've already noticed it at exactly the location in the video and near the door of the starting room. It's a z-bufferering issue caused by the planes of the objects' triangles lying into each other (or at least they are very close). The flickering can have many reasons, for example inaccuracies in the vertex calculations when transforming the vertices into camera space, different rendering order (not very likely, but possible) or plain and simple inaccuracies in the z-buffer and/or the z-buffer optimizations the GPU performs. In similar situations, one can very well see the tile structure in which the ATI chips are rendering the picture due to such inaccuracies.
Changing the z-buffer's depth won't help here. The only solution is a geometrical one: Avoid that it happens when creating the scene. As long as two or more triangles' planes are lying into each other and the triangles overlap, you'll always see such artifacts. They may differ from hardware to hardware, but the basic problem remains.

rolz

Thanks, i got it. Going to redesign levels so that they dont have overlapping walls
Regards,
Andrei