mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
Implement support for FSAA in combination with post-processing (#15392)
- Actually it's MSAA I think, or perhaps the terms are equivalent - I've made it fit into the existing Irrlicht architecture, but that has resulted in code duplication compared to my original "hacky" approach - OpenGL 3.2+ and OpenGL ES 3.1+ are supported - EDT_OPENGL3 is not required, EDT_OPENGL works too - Helpful tutorial: https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing, section "Off-screen MSAA" - This may be rough around the edges, but in general it works
This commit is contained in:
@@ -85,13 +85,19 @@ class COpenGLCoreCacheHandler
|
||||
GL.BindTexture(prevTextureType, 0);
|
||||
|
||||
#if defined(IRR_COMPILE_GL_COMMON)
|
||||
GL.Disable(prevTextureType);
|
||||
GL.Enable(curTextureType);
|
||||
// The "enable/disable texture" stuff is so legacy that
|
||||
// it's not even allowed for multisample textures.
|
||||
// (IRR_COMPILE_GL_COMMON is for the legacy driver.)
|
||||
if (prevTextureType != GL_TEXTURE_2D_MULTISAMPLE)
|
||||
GL.Disable(prevTextureType);
|
||||
if (curTextureType != GL_TEXTURE_2D_MULTISAMPLE)
|
||||
GL.Enable(curTextureType);
|
||||
#endif
|
||||
}
|
||||
#if defined(IRR_COMPILE_GL_COMMON)
|
||||
else if (!prevTexture)
|
||||
GL.Enable(curTextureType);
|
||||
if (curTextureType != GL_TEXTURE_2D_MULTISAMPLE)
|
||||
GL.Enable(curTextureType);
|
||||
#endif
|
||||
|
||||
GL.BindTexture(curTextureType, static_cast<const TOpenGLTexture *>(texture)->getOpenGLTextureName());
|
||||
@@ -110,7 +116,8 @@ class COpenGLCoreCacheHandler
|
||||
GL.BindTexture(prevTextureType, 0);
|
||||
|
||||
#if defined(IRR_COMPILE_GL_COMMON)
|
||||
GL.Disable(prevTextureType);
|
||||
if (prevTextureType != GL_TEXTURE_2D_MULTISAMPLE)
|
||||
GL.Disable(prevTextureType);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user