-
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
Rendering artifacts at different viewport sizes #282
Comments
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>
Parts 1-3 are now fixed in #283. |
Regarding part 4, it is the chunk of external_sky_bot_col.mp4Now, the reason this happens is because the below code doesn't take dethrace/src/DETHRACE/common/depth.c Lines 498 to 506 in 83ba373
This can be easily fixed by respecting said offsets:
However, the OG does not do that. I wonder why it works for them - they still keep track of @dethrace-labs @madebr |
Fixed with software renderer |
Deathrace exhibits multiple issues related to rendering the 3d part of the screen in non-full resolution (i.e. manipulating the viewport size with -/+ keys):
1. Depth buffer
When the
gRender_screen
is scaled such that it doesn't match dimensions ofgBack_screen
, the depth buffer's position and size differs from the color buffer, causing visible artifacts on the screen:2. Blending
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:
3. Blending in map mode
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. The result is fully opaque transparencies:
4. External sky
Depending on the screen size, something seems to obstruct different parts of the external sky:
external_sky.mp4
Currently, I can't tell whether this is geometry, or the sky bitmap not rendering properly.
The text was updated successfully, but these errors were encountered: