diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.I b/panda/src/glstuff/glGraphicsStateGuardian_src.I index fc60126957..9603733a11 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.I +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.I @@ -94,7 +94,9 @@ enable_multisample(bool val) { if (val) { GLP(Enable)(GL_MULTISAMPLE); } else { - GLP(Disable)(GL_MULTISAMPLE); + if (!_multisample_alpha_one_enabled && !_multisample_alpha_mask_enabled) { + GLP(Disable)(GL_MULTISAMPLE); + } } } } @@ -262,8 +264,12 @@ enable_multisample_alpha_one(bool val) { _multisample_alpha_one_enabled = val; if (val) { GLP(Enable)(GL_SAMPLE_ALPHA_TO_ONE); + GLP(Enable)(GL_MULTISAMPLE); } else { GLP(Disable)(GL_SAMPLE_ALPHA_TO_ONE); + if (!_multisample_enabled) { + GLP(Disable)(GL_MULTISAMPLE); + } } } } @@ -280,8 +286,12 @@ enable_multisample_alpha_mask(bool val) { _multisample_alpha_mask_enabled = val; if (val) { GLP(Enable)(GL_SAMPLE_ALPHA_TO_COVERAGE); + GLP(Enable)(GL_MULTISAMPLE); } else { GLP(Disable)(GL_SAMPLE_ALPHA_TO_COVERAGE); + if (!_multisample_enabled) { + GLP(Disable)(GL_MULTISAMPLE); + } } } } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ce218ca81a..856f595158 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -438,8 +438,15 @@ reset() { _buffer_mask &= ~RenderBuffer::T_back; } - // Set up the specific state values to GL's known initial values. + // Ensure the initial state is what we say it should be (in some + // cases, we don't want the GL default settings; in others, we have + // to force the point with some drivers that aren't strictly + // compliant w.r.t. initial settings). GLP(FrontFace)(GL_CCW); + GLP(Disable)(GL_MULTISAMPLE); + GLP(Disable)(GL_LINE_SMOOTH); + GLP(Disable)(GL_POINT_SMOOTH); + GLP(Disable)(GL_POLYGON_SMOOTH); // Set up all the enabled/disabled flags to GL's known initial // values: everything off.