FREESCAPE: Depth rendering based on the original implementation#7049
Merged
neuromancer merged 13 commits intoscummvm:masterfrom Mar 1, 2026
Merged
FREESCAPE: Depth rendering based on the original implementation#7049neuromancer merged 13 commits intoscummvm:masterfrom
neuromancer merged 13 commits intoscummvm:masterfrom
Conversation
Member
|
I have a quick question: do you still need to disable DEPTH_TEST everywhere? |
Contributor
Author
|
Good catch: yes, no need to disable it, except when it is enabled for some specific cases. |
Member
|
Sounds and looks logical to me |
Contributor
Author
|
This PR is currently blocked by a few artifacts that I need to debug in the code, where the sorting results in boundind boxes that are not correct and very visible glitches. |
objects like door handles were flickering from some camera position, this is solved in this commit.
eb91eeb to
64d63d8
Compare
added command to print sort order, show occlusion boxes and improved iso command to isolate multiple objects and only sort and render isolated objects.
Contributor
Author
|
@dhruv0154 kindly improved the debug console and fixed the outstanding artifacts. This PR will be in testing for a bit in case there are more artifacts and then merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the on-going work to replace the current approach to compute depth information, from z-buffer to the painter's algorithm similar to the original implementation. Despite the freescape game are from an era where GPUs where not even invented, modern OpenGL have a lot of trouble to correctly render the levels correctly using their z-buffer. The reason for that is coplanar triangles produce z-fighting. There are many tricks to minimize it, but it is very hard to completely remove it. On the first game, Driller, this is not bad, but later games like Castle Master, it is very easy to note these artifacts.
The solution, is of course, follow the original implementation that sorted bounding boxes according some kind of distance. In this PR, we used the annotated assembly code from @santiontanon to reimplement it.
Let's see how it changed, these are screenshots from
masterplaying Castle Master for ZX Spectrum:And this is with the sorting code:
And finally, the original implementation (apologies for the low quality!)
Finally, regardless of the state, this PR should NOT merged before tagging of 3.0.0. It will be featured in 3.0.1.