Author Topic: Sorting problems with GLRenderer  (Read 3535 times)

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Sorting problems with GLRenderer
« on: February 14, 2006, 10:52:54 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Sorting problems with GLRenderer
« Reply #1 on: February 14, 2006, 04:47:07 pm »
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?

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Sorting problems with GLRenderer
« Reply #2 on: February 15, 2006, 11:00:15 am »
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.
« Last Edit: November 07, 2010, 11:00:34 pm by EgonOlsen »
Regards,
Andrei

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Sorting problems with GLRenderer
« Reply #3 on: February 15, 2006, 11:19:44 am »
Woops, i would like to take back my statements about fullscreen mode only - the problem appears also in windowed mode
Regards,
Andrei

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Sorting problems with GLRenderer
« Reply #4 on: February 15, 2006, 05:58:37 pm »
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.

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Sorting problems with GLRenderer
« Reply #5 on: February 16, 2006, 10:35:59 am »
Thanks, i got it. Going to redesign levels so that they dont have overlapping walls
Regards,
Andrei