Remove support for GL_POINT_SMOOTH and GL_LINE_SMOOTH antialiasing

These antialiasing techniques have been removed in OpenGL 3.1, they were often executed by the CPU, and Minetest does not use them.
The OpenGL wiki recommends that we do not use this functionality in our program.
https://www.khronos.org/opengl/wiki/Multisampling#Smooth_antialiasing
This commit is contained in:
HybridDog 2024-02-17 22:01:37 +01:00 committed by sfan5
parent 0069837920
commit f91be59811
3 changed files with 28 additions and 74 deletions

@ -193,16 +193,9 @@ namespace video
EAAM_SIMPLE=1, EAAM_SIMPLE=1,
//! High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode //! High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode
EAAM_QUALITY=3, EAAM_QUALITY=3,
//! Line smoothing
//! Careful, enabling this can lead to software emulation under OpenGL
EAAM_LINE_SMOOTH=4,
//! point smoothing, often in software and slow, only with OpenGL
EAAM_POINT_SMOOTH=8,
//! All typical anti-alias and smooth modes
EAAM_FULL_BASIC=15,
//! Enhanced anti-aliasing for transparent materials //! Enhanced anti-aliasing for transparent materials
/** Usually used with EMT_TRANSPARENT_ALPHA_CHANNEL_REF and multisampling. */ /** Usually used with EMT_TRANSPARENT_ALPHA_CHANNEL_REF and multisampling. */
EAAM_ALPHA_TO_COVERAGE=16 EAAM_ALPHA_TO_COVERAGE=4
}; };
//! These flags allow to define the interpretation of vertex color when lighting is enabled //! These flags allow to define the interpretation of vertex color when lighting is enabled

@ -125,8 +125,6 @@ bool COGLES1Driver::genericDriverInit(const core::dimension2d<u32>& screenSize,
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST);
glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glFrontFace(GL_CW); glFrontFace(GL_CW);
glAlphaFunc(GL_GREATER, 0.f); glAlphaFunc(GL_GREATER, 0.f);
@ -1797,8 +1795,6 @@ void COGLES1Driver::setBasicRenderStates(const SMaterial& material, const SMater
// Anti aliasing // Anti aliasing
if (resetAllRenderStates || lastmaterial.AntiAliasing != material.AntiAliasing) if (resetAllRenderStates || lastmaterial.AntiAliasing != material.AntiAliasing)
{
// if (FeatureAvailable[IRR_ARB_multisample])
{ {
if (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE) if (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
@ -1810,22 +1806,6 @@ void COGLES1Driver::setBasicRenderStates(const SMaterial& material, const SMater
else else
glDisable(GL_MULTISAMPLE); glDisable(GL_MULTISAMPLE);
} }
if ((material.AntiAliasing & EAAM_LINE_SMOOTH) != (lastmaterial.AntiAliasing & EAAM_LINE_SMOOTH))
{
if (material.AntiAliasing & EAAM_LINE_SMOOTH)
glEnable(GL_LINE_SMOOTH);
else if (lastmaterial.AntiAliasing & EAAM_LINE_SMOOTH)
glDisable(GL_LINE_SMOOTH);
}
if ((material.AntiAliasing & EAAM_POINT_SMOOTH) != (lastmaterial.AntiAliasing & EAAM_POINT_SMOOTH))
{
if (material.AntiAliasing & EAAM_POINT_SMOOTH)
// often in software, and thus very slow
glEnable(GL_POINT_SMOOTH);
else if (lastmaterial.AntiAliasing & EAAM_POINT_SMOOTH)
glDisable(GL_POINT_SMOOTH);
}
}
// Texture parameters // Texture parameters
setTextureRenderStates(material, resetAllRenderStates); setTextureRenderStates(material, resetAllRenderStates);

@ -171,8 +171,6 @@ bool COpenGLDriver::genericDriverInit()
glClearDepth(1.0); glClearDepth(1.0);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
glFrontFace(GL_CW); glFrontFace(GL_CW);
// adjust flat coloring scheme to DirectX version // adjust flat coloring scheme to DirectX version
#if defined(GL_ARB_provoking_vertex) || defined(GL_EXT_provoking_vertex) #if defined(GL_ARB_provoking_vertex) || defined(GL_EXT_provoking_vertex)
@ -2557,10 +2555,9 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
} }
// Anti aliasing // Anti aliasing
if (resetAllRenderStates || lastmaterial.AntiAliasing != material.AntiAliasing) if ((resetAllRenderStates
{ || lastmaterial.AntiAliasing != material.AntiAliasing)
if (FeatureAvailable[IRR_ARB_multisample]) && FeatureAvailable[IRR_ARB_multisample]) {
{
if (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE) if (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
else if (lastmaterial.AntiAliasing & EAAM_ALPHA_TO_COVERAGE) else if (lastmaterial.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
@ -2582,22 +2579,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
else else
glDisable(GL_MULTISAMPLE_ARB); glDisable(GL_MULTISAMPLE_ARB);
} }
if ((material.AntiAliasing & EAAM_LINE_SMOOTH) != (lastmaterial.AntiAliasing & EAAM_LINE_SMOOTH))
{
if (material.AntiAliasing & EAAM_LINE_SMOOTH)
glEnable(GL_LINE_SMOOTH);
else if (lastmaterial.AntiAliasing & EAAM_LINE_SMOOTH)
glDisable(GL_LINE_SMOOTH);
}
if ((material.AntiAliasing & EAAM_POINT_SMOOTH) != (lastmaterial.AntiAliasing & EAAM_POINT_SMOOTH))
{
if (material.AntiAliasing & EAAM_POINT_SMOOTH)
// often in software, and thus very slow
glEnable(GL_POINT_SMOOTH);
else if (lastmaterial.AntiAliasing & EAAM_POINT_SMOOTH)
glDisable(GL_POINT_SMOOTH);
}
}
// Texture parameters // Texture parameters
setTextureRenderStates(material, resetAllRenderStates); setTextureRenderStates(material, resetAllRenderStates);