-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport fixes #283
Viewport fixes #283
Conversation
When the `gRender_screen` is scaled such that it doesn't match dimensions of `gBack_screen`, the depth buffer's position and size differs from the color buffer, causing visible artifacts on the screen. Update the depth buffer along the color buffer, so that they always match, preventing any misalignment. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
The viewport height passed to the shader should be the one of the renderer, not the color buffer. Otherwise, geometry behind transparent materials is sampled at the wrong y offset. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
When map mode is enabled, the scene is rendered thrice to a single frame. This breaks blending in GL renderer, which depends on a clear depth buffer. Don't wait for game loop to swap the frame buffers and manually clear the depth buffer as soon as the scene is done rendering. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
#279 resolves 1 and 2 of the linked issues - different implementation for 1 but same for 2! |
@@ -389,6 +389,10 @@ void GLRenderer_EndScene() { | |||
|
|||
generated_current_framebuffer_for_this_frame = 0; | |||
CHECK_GL_ERROR("GLRenderer_EndScene"); | |||
|
|||
/* Fixes blending in map mode, which renders the scene thrice per frame. */ | |||
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has the effect of breaking shadow rendering. Instead, I'm happy to wrap the for loop in RenderAFrame
in a #if DETHRACE_FIX_BUGS
, which should also resolve the issue?
I've looked and looked and can't see any reason for it. My guess is it was some leftover from a debugging session that made it into the retail build as an oversight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the issue is gone if we only loop once. I also spent some time trying to understand the logic behind the loop and got nothing. So I'm fine with the workaround you're proposing.
Have we tried to hack CARMA95.EXE, so it only loops once, to see if anything breaks there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an existing issue here #143 for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I was curious again so just tried it (I updated the linked issue #143). Couldn't see anything broken :/
Closing this as we've resolved 2/3 issues as part of other earlier fixes, and the map rendering issue is resolved by #317 |
This is a collection of fixes for #282.