-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add missing max. number of samples (MSAA) check #9916
Conversation
int max_samples = 0; | ||
glGetIntegerv(GL_MAX_SAMPLES, &max_samples); | ||
if (msaa > max_samples) { | ||
WARN_PRINT("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES."); |
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.
Maybe display the value of GL_MAX_SAMPLES too for clarity? Otherwise it's trial and error to find out the GPU limitation I guess?
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.
Done
Hm, would be interesting to retrieve this value in-game somehow, so if we add a "Graphics Options" menu, it's possible to limit to the player's hardware capability. |
More globally, we could have something like |
Indeed ! If there is a way to retrieve this value, I'm interested. |
@fabriceci Is there a lot of hardware out there that doesn't support MSAA past 8×? (I don't consider 16× MSAA here as it's too expensive to be usable in a modern engine.) Given Godot's current rendering performance, it might not make sense to expose 8× MSAA to players in the first place anyway. You'll need to give up a lot of visual effects if you want to use 8× MSAA and keep a good framerate. To be fair, I think we should unexpose 16× MSAA from Godot 4.0 altogether as it's often buggy in graphics drivers and causes weird issues. This is because it's usually implemented as 2× SSAA + 8× MSAA in the graphics driver - we have no control over this. The difference between 8× MSAA and 16× MSAA is very small anyway, even in screenshots. |
@Calinou I had the warning on mac when I try to set 16x MSAA, that what leads me to this issue, I will limit MSAA to 8X to get rid of that like you suggest and explained. To be honest, I thought 16x was too much, but by tests, I noticed that it's the only one that be able to remove pixelation effect on cube's edges (a bit less notable here due to compression): |
Fixes #9908.
OpenGL ref - glRenderbufferStorageMultisample