X Tutup
Skip to content

FREESCAPE: Fix for #15486 TINYGL: triangles always override zbuffer from lines#6527

Merged
neuromancer merged 1 commit intoscummvm:masterfrom
For-Chance:fix/tgl-line-zbuffer
Apr 1, 2025
Merged

FREESCAPE: Fix for #15486 TINYGL: triangles always override zbuffer from lines#6527
neuromancer merged 1 commit intoscummvm:masterfrom
For-Chance:fix/tgl-line-zbuffer

Conversation

@For-Chance
Copy link
Contributor

Fix incorrect depth buffer writing in render pipeline of TGL_LINES

  • Add kDepthWrite parameter to control depth updates
  • Modify the the affected code to render first planar, then non-planar objects

@neuromancer neuromancer requested a review from aquadran April 1, 2025 07:54
@For-Chance For-Chance force-pushed the fix/tgl-line-zbuffer branch from 0c92941 to 4396f97 Compare April 1, 2025 10:12
@For-Chance For-Chance force-pushed the fix/tgl-line-zbuffer branch from 4396f97 to 78d2385 Compare April 1, 2025 10:14
@For-Chance
Copy link
Contributor Author

Debugging Process

  1. After tweaking the rendering of TGL_LINES and TGL_TRIANGLES several times, the first thing I did was to determine that this bug only occurs during the depth testing of TGL_LINES.
  2. Keep only one TGL_LINES and one TGL_TRIANGLES element in the scene.
  3. Then it was a constant process of interrupting the point to view the rendered pipeline, constantly troubleshooting every possible error. Until I troubleshooted to line 120 in the zline.cpp file (putPixel<kDepthWrite, kEnableScissor>(pixelOffset, color, x, y, z);), I started to go to see the change in the z-value before and after the z-value assignment.And I found out that if the TGL_LINES draws first, although the pixel value changed, but the z-values before and after did not change, so the problem must be in this line.
  4. I then went further into this function call and found the problem with the bug.

The reason for this bug is that the TGL_LINES drawing passes the depth test and then updates the pixel values but not the depth values.

@neuromancer neuromancer merged commit 159168c into scummvm:master Apr 1, 2025
1 check passed
@neuromancer neuromancer added the GSoC Part of a Google Summer of Code project label Apr 1, 2025
@For-Chance For-Chance deleted the fix/tgl-line-zbuffer branch April 1, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Part of a Google Summer of Code project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup