forked from Mirrorlandia_minetest/irrlicht
master #5
@ -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);
|
||||||
@ -1798,33 +1796,15 @@ 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)
|
||||||
{
|
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||||
if (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
|
else if (lastmaterial.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
|
||||||
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||||
else if (lastmaterial.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)
|
|
||||||
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
|
||||||
|
|
||||||
if ((AntiAlias >= 2) && (material.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)))
|
if ((AntiAlias >= 2) && (material.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)))
|
||||||
glEnable(GL_MULTISAMPLE);
|
glEnable(GL_MULTISAMPLE);
|
||||||
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
|
||||||
|
@ -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,46 +2555,29 @@ 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)
|
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
|
||||||
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
|
|
||||||
|
|
||||||
if ((AntiAlias >= 2) && (material.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)))
|
if ((AntiAlias >= 2) && (material.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)))
|
||||||
{
|
{
|
||||||
glEnable(GL_MULTISAMPLE_ARB);
|
glEnable(GL_MULTISAMPLE_ARB);
|
||||||
#ifdef GL_NV_multisample_filter_hint
|
#ifdef GL_NV_multisample_filter_hint
|
||||||
if (FeatureAvailable[IRR_NV_multisample_filter_hint])
|
if (FeatureAvailable[IRR_NV_multisample_filter_hint])
|
||||||
{
|
{
|
||||||
if ((material.AntiAliasing & EAAM_QUALITY) == EAAM_QUALITY)
|
if ((material.AntiAliasing & EAAM_QUALITY) == EAAM_QUALITY)
|
||||||
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
|
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
|
||||||
else
|
else
|
||||||
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_FASTEST);
|
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_FASTEST);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
#endif
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
glDisable(GL_MULTISAMPLE_ARB);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Texture parameters
|
// Texture parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user