Skip to content
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

Fix Color and Clear Problems on OpenGL Backend #1628

Closed
wants to merge 1 commit into from

Conversation

zicklag
Copy link
Contributor

@zicklag zicklag commented Jul 10, 2021

  • Disabled writing to the alpha channel of the draw framebuffer. This
    fixes pixelated edges around the borders of the clear color.
  • Disable sRGB mode when creating the EGL surface. This was causing the
    color of the OpenGL backend to appear "washed-out" compared to the
    other backends.

Connections
Fixes #1627

Description
Fixes some rendering differences between OpenGL and Vulkan backends on Linux:

Before:

image

After:

Testing
Tested on my Linux Pop!_OS ( Ubuntu ) 20.04 laptop using my "Mesa Intel(R) UHD Graphics (CML GT2)" adapter.


Extra info:

  • I'm not 100% sure it's the right move to disable the alpha write to the draw framebuffer. It might disable the ability to use the GL backend for transparent windows, but I don't really know anything about transparent windows or if there are other problems/setup needed to make that work.
  • I'm not sure why disabling sRGB fixed the color issue, or whether or not there needs to be more work done to make that actually do what it's intented to do.

- Disabled writing to the alpha channel of the draw framebuffer. This
   fixes pixelated edges around the borders of the clear color.
- Disable sRGB mode when creating the EGL surface. This was causing the
  color of the OpenGL backend to appear "washed-out" compared to the
  other backends.
@zicklag zicklag force-pushed the opengl-color-issues branch from e484b3f to 2d7fc03 Compare July 10, 2021 19:29
attributes.push(egl::GL_COLORSPACE as usize);
attributes.push(egl::GL_COLORSPACE_SRGB as usize);
}
// sRGB caused color problems, making the render lighter colored than the vulkan version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just remove this code entirely

@@ -533,7 +533,7 @@ impl super::Queue {
0,
);
}
gl.color_mask(true, true, true, true);
gl.color_mask(true, true, true, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this is certainly not the fix we want.
Isn't the shadow example outputting all alpha = 1 anyway?

This sounds like one of the following possibilities:

  • alpha compositing mode is messed up, and we produce alpha that isn't 1.0
  • driver bug

@zicklag
Copy link
Contributor Author

zicklag commented Jul 12, 2021

After investigation by @cwfitzgerald and testing summarized in my comment ( #1627 (comment) ) it seems like neither of these changes should actually be made and we need to find different ways around the issues so I'll close this.

@zicklag zicklag closed this Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fastclear Bug With Intel Mesa Adapters on the GL Backend
2 participants