View Issue Details

IDProjectCategoryView StatusLast Update
0005502DarkRadiantRendererpublic13.04.2024 14:01
ReporterDragofer Assigned Toorbweaver  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
Product Version2.10.0 
Fixed in Version3.9.0 
Summary0005502: Surfaces render through other surfaces on AMD cards
DescriptionAMD machines seem to have problems with DR's camera renderer: you can often see surfaces through other surfaces (broken depth testing?) in a jagged alternating pattern, which gets worse with the far clip plane enabled.

The Chooser windows seem to always have the far clip plane enabled regardless of menu settings, which makes it difficult to preview large models and prefabs.
Additional InformationThis has occurred for the following users:
- myself on an RX 460
- bikerdude on an RX 570
- aluminumhaste, don't know what his AMD card is
- jonri on Vega 8 (Linux)
TagsNo tags attached.
Attached Files
preview_farclip.png (241,281 bytes)   
preview_farclip.png (241,281 bytes)   

Relationships

related to 0006148 new Setting for far clip plane should affect all camera windows 

Activities

Dragofer

Dragofer

30.10.2022 17:01

developer   ~0015376

Aluminumhaste is seeing the same rendering issues on his AMD setup: https://forums.thedarkmod.com/index.php?/topic/21638-darkradiant-350-released/&do=findComment&comment=479999
Dragofer

Dragofer

30.10.2022 17:25

developer   ~0015377

Camera view of the merchant ship deck 2 prefabs ( prefabs > nautical > ship_merchant > interior_deck2.pfbx) with far clip plane disabled.
image.png (305,810 bytes)
Dragofer

Dragofer

30.10.2022 17:27

developer   ~0015378

Camera view of the merchant ship deck 2 prefabs, this time with far clip plane enabled (and zoomed in closer)
image-2.png (406,309 bytes)
Dragofer

Dragofer

30.10.2022 17:29

developer   ~0015379

Reworked this ticket as it affects all camera renders, not just the prefab chooser.
Dragofer

Dragofer

30.10.2022 17:53

developer   ~0015380

Model chooser view of galleon_hull_open - note how you can only see thin slivers of the bullseye windows and cannon hatches along the hull, even at this close-up.
image-3.png (448,155 bytes)
greebo

greebo

31.10.2022 04:09

administrator   ~0015381

I'm out of machines with AMD cards here. I'd like to, but I cannot even attempt to debug this until the situation changes.

AluminumHaste seems to have found that this has been introduced in some driver version, so maybe there's a compatibility setting somewhere that might work around this problem?
Dragofer

Dragofer

31.10.2022 10:57

developer   ~0015383

Do you mean AluminumHaste's post a little higher up in that thread relating to the outlines? I don't think that post was related to this rendering bug. But in any case worth looking for compatibility settings.

A further workaround would be to make sure that the setting for enabling far-clip plane affects not just the camera view, but also all chooser views. It's confusing anyway when you try to preview something that's so large that the initial zoom level is beyond the far clip plane.

I'd be glad to assist by compiling from source and running debugging tools, I've already done that a fair amount myself for TDM development.
jonri

jonri

02.11.2022 02:24

developer   ~0015385

Add AMD Vega 8 on Linux to the list of affected cards. I have AMD in my laptop and my desktop, so I'd be willing to try to look into this. I'm away this week but could dig into it next week.
greebo

greebo

02.11.2022 03:55

administrator   ~0015386

At this point any help or insight is appreciated!
Dragofer

Dragofer

21.11.2022 20:01

developer   ~0015458

Trying DR 3.6 - which I believe should have far clip disabled in the Prefab Chooser view - the issue seems unimproved.
orbweaver

orbweaver

17.01.2023 20:33

developer   ~0015814

Last edited: 17.01.2023 20:33

Does not reproduce for me on Vega 56 using the amdgpu driver on Ubuntu 22.04. I think we need more information about the environments this is happening on, e.g.
- Which driver (amdgpu, radeonsi, fglrx).
- Which distro and version.
- Which specific graphics card.
- Which desktop environment and windowing system (GNOME or KDE, Xorg or Wayland).
jonri

jonri

18.02.2023 18:21

developer   ~0015954

I've managed to make the problem go away by changing the depth buffer from 16-bit to 24-bit. Specifically, find WX_GL_DEPTH_SIZE at the top of GLWidget.cpp and change the 16 to 24.

This feels like a band-aid over the actual problem, and I'm not sure if changing this setting would affect performance or compatibility.
depth_buffer.png (627,426 bytes)
Dragofer

Dragofer

03.02.2024 18:49

developer   ~0016477

My current system:
- OS: Win11 with latest updates
- Dedicated GPU: AMD RX 7600S
- Integrated GPU: AMD Radeon 780M on an AMD Rzyen 9 7940hs CPU
- Driver: Adrenalin 24.1.1 (most recent version at this time)
- Not sure what to say about the desktop environment. Whatever comes stock with Win11?

Also happened on my previous system:
- Win10 64 bit
- AMD RX 460 with whatever was the latest Adrenalin driver made for this card
orbweaver

orbweaver

06.03.2024 20:19

developer   ~0016563

I've never even heard of a depth buffer being less than 24 bits, so if that fixes the issue I'm happy to change it. It would certainly make sense that the limited precision of 16 bit buffer would cause issues.
orbweaver

orbweaver

06.03.2024 20:29

developer   ~0016564

Depth buffer set to 24 bits in df2f7a96e117931dc922032b0270a8b62e1002b6 as suggested in the comments by jonri.

Since I have not seen this issue on my system (despite having an AMD card on Linux), someone else will need to confirm the fix.
Dragofer

Dragofer

31.03.2024 16:00

developer   ~0016607

Last edited: 31.03.2024 16:02

Using DR 3.9, this looks a lot better now. For example, the house 8 prefab now looks like this in the prefab preview (compare to the original version I screenshotted in the comments).

Regular camera view with far clip plane enabled also looks considerably better.

In some cases you can still see some caulk bleeding through along the edges, but it's a lot better now.
image-4.png (485,980 bytes)
orbweaver

orbweaver

13.04.2024 14:01

developer   ~0016645

Seems to be resolved.

Related Changesets

DarkRadiant: master df2f7a96

06.03.2024 20:25

orbweaver


Details Diff
0005502: set depth buffer size to 24 bits

Although the wxGLCanvas wiki tutorial uses a depth buffer of 16 bits, this is
extremely low precision for a depth buffer, and is likely the cause of
the Z fighting issues described in 0005502.

We now set it to the more usual 24 bits, as confirmed by OpenGL
tutorials such as https://learnopengl.com/Advanced-OpenGL/Depth-testing
Affected Issues
0005502
mod - libs/wxutil/GLWidget.cpp Diff File

Issue History

Date Modified Username Field Change
24.01.2021 16:35 Dragofer New Issue
24.01.2021 16:35 Dragofer File Added: preview_farclip.png
24.01.2021 16:36 Dragofer Relationship added related to 0005455
24.01.2021 16:39 greebo Status new => acknowledged
25.01.2021 10:17 Dragofer Summary Less aggressive far-clip plane in Prefab Chooser preview => More accurate rendering of prefabs in Prefab Chooser preview
28.01.2021 13:23 Dragofer Priority low => normal
28.01.2021 13:23 Dragofer Severity minor => normal
28.01.2021 13:23 Dragofer Summary More accurate rendering of prefabs in Prefab Chooser preview => Broken rendering of prefabs in Prefab Chooser preview on AMD cards
30.10.2022 17:01 Dragofer Note Added: 0015376
30.10.2022 17:23 Dragofer Summary Broken rendering of prefabs in Prefab Chooser preview on AMD cards => Broken rendering on AMD cards, especially with far clip plane enabled
30.10.2022 17:23 Dragofer Description Updated
30.10.2022 17:24 Dragofer Additional Information Updated
30.10.2022 17:25 Dragofer Note Added: 0015377
30.10.2022 17:25 Dragofer File Added: image.png
30.10.2022 17:26 Dragofer Summary Broken rendering on AMD cards, especially with far clip plane enabled => Surfaces render through other surfaces on AMD cards
30.10.2022 17:26 Dragofer Description Updated
30.10.2022 17:27 Dragofer Note Added: 0015378
30.10.2022 17:27 Dragofer File Added: image-2.png
30.10.2022 17:28 Dragofer Relationship deleted related to 0005455
30.10.2022 17:29 Dragofer Note Added: 0015379
30.10.2022 17:47 Dragofer Description Updated
30.10.2022 17:53 Dragofer Note Added: 0015380
30.10.2022 17:53 Dragofer File Added: image-3.png
30.10.2022 17:54 Dragofer Additional Information Updated
31.10.2022 04:09 greebo Note Added: 0015381
31.10.2022 10:57 Dragofer Note Added: 0015383
31.10.2022 11:01 Dragofer Relationship added related to 0006148
31.10.2022 11:21 Dragofer Category GUI => Renderer
02.11.2022 02:24 jonri Note Added: 0015385
02.11.2022 03:56 greebo Note Added: 0015386
02.11.2022 07:18 Dragofer Additional Information Updated
21.11.2022 20:01 Dragofer Note Added: 0015458
17.01.2023 20:33 orbweaver Note Added: 0015814
17.01.2023 20:33 orbweaver Note Edited: 0015814
18.02.2023 18:21 jonri Note Added: 0015954
18.02.2023 18:21 jonri File Added: depth_buffer.png
03.02.2024 18:49 Dragofer Note Added: 0016477
06.03.2024 20:19 orbweaver Note Added: 0016563
06.03.2024 20:19 orbweaver Assigned To => orbweaver
06.03.2024 20:19 orbweaver Status acknowledged => assigned
06.03.2024 20:29 orbweaver Status assigned => feedback
06.03.2024 20:29 orbweaver Note Added: 0016564
08.03.2024 05:52 orbweaver Changeset attached => DarkRadiant master df2f7a96
31.03.2024 16:00 Dragofer Note Added: 0016607
31.03.2024 16:00 Dragofer File Added: image-4.png
31.03.2024 16:00 Dragofer Status feedback => assigned
31.03.2024 16:02 Dragofer Note Edited: 0016607
13.04.2024 14:01 orbweaver Status assigned => resolved
13.04.2024 14:01 orbweaver Resolution open => fixed
13.04.2024 14:01 orbweaver Fixed in Version => 3.9.0
13.04.2024 14:01 orbweaver Note Added: 0016645