Bug 92286 - Distant geometry renders in front of closer geometry (depth test fail) in DarkRadiant / wxWidgets
Summary: Distant geometry renders in front of closer geometry (depth test fail) in Dar...
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-05 14:16 UTC by MirceaKitsune
Modified: 2018-05-11 04:38 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Screenshot of the depth sorting issue (669.06 KB, text/plain)
2015-10-05 14:16 UTC, MirceaKitsune
Details

Description MirceaKitsune 2015-10-05 14:16:12 UTC
Created attachment 118669 [details]
Screenshot of the depth sorting issue

Mesa users appear to experience a strange problem with Dark Radiant (the map editor of The Dark Mod): Depth testing does not work, causing surfaces hidden behind over surfaces to render through them in a random order.

I decided to report the problem here since it only happens on Linux and the free graphics driver. I experience it on my Radeon 6870 card, and someone else reported the same issue on an Intel card. Currently I am running Mesa 10.3.7. I looked through the DarkRadiant code and did intensive testing, but nothing I found appears to be related to this, and the source of the problem is a complete mystery to everyone.

Important highlights: The problem persists if I disable transparency on all surfaces, despite this potentially being an alpha sorting issue. It also occurs regardless of rendering mode (wireframe / solid / textured / lighting). Surfaces in a single model can overlap each other too, so it's not just some objects overlapping others. Any DarkRadiant window that renders geometry is affected, not only the viewport. Also note that DarkRadiant uses wxWidgets, and its older GTK variant does not have the problem... meaning it might be wxWidgets related in addition.

Please follow my reports on the TDM forum and bug tracker as well, which contain even more information and might get updated more timely:

http://forums.thedarkmod.com/topic/16848-distant-geometry-renders-in-front-of-closer-geometry/

http://bugs.thedarkmod.com/view.php?id=4017
Comment 1 MirceaKitsune 2015-10-05 19:01:57 UTC
The cause of the issue has been at last found, thanks to a suggestion by OrbWeaver. It was triggered by initializing the WX OpenGL canvas without any attributes, which caused Mesa to assume no depth buffer at all. I have created a patch for DarkRadiant which makes it usable.

I guess the question of this bug report remains whether Mesa is doing something wrong here. On the proprietary video drivers, it's ok to leave the attribs parameter of wxGLCanvas empty... but for depth buffering to work on Mesa, you must include WX_GL_DEPTH_SIZE and give it a buffer size.

So if anyone here is familiar with wxWidgets, please take a look at this. If you think Mesa is doing the right thing, this report can be closed. I don't know enough to decide that, but to me it feels like depth testing being the only thing that doesn't work in this scenario denotes a problem.
Comment 2 Roland Scheidegger 2015-10-05 19:49:12 UTC
(In reply to MirceaKitsune from comment #1)
> I guess the question of this bug report remains whether Mesa is doing
> something wrong here. On the proprietary video drivers, it's ok to leave the
> attribs parameter of wxGLCanvas empty... but for depth buffering to work on
> Mesa, you must include WX_GL_DEPTH_SIZE and give it a buffer size.
> 
> So if anyone here is familiar with wxWidgets, please take a look at this. If
> you think Mesa is doing the right thing, this report can be closed. I don't
> know enough to decide that, but to me it feels like depth testing being the
> only thing that doesn't work in this scenario denotes a problem.

I'm not familiar with wxWidgets, but this definitely doesn't sound like a mesa bug. If you don't explicitly request a visual with depth bits, then you may or may not get a depth buffer, and it looks like it just happens some proprietary drivers will give you a visual with it but mesa won't.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.