mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00: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:
parent
a8ea165042
commit
9b6a399011
23 changed files with 290 additions and 42 deletions
|
@ -129,6 +129,9 @@ enum E_VIDEO_DRIVER_FEATURE
|
|||
//! Support for clamping vertices beyond far-plane to depth instead of capping them.
|
||||
EVDF_DEPTH_CLAMP,
|
||||
|
||||
//! Support for multisample textures.
|
||||
EVDF_TEXTURE_MULTISAMPLE,
|
||||
|
||||
//! Only used for counting the elements of this enum
|
||||
EVDF_COUNT
|
||||
};
|
||||
|
|
|
@ -26,6 +26,7 @@ enum E_CUBE_SURFACE
|
|||
};
|
||||
|
||||
//! Interface of a Render Target.
|
||||
/** This is a framebuffer object (FBO) in OpenGL. */
|
||||
class IRenderTarget : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -156,6 +156,9 @@ enum E_TEXTURE_TYPE
|
|||
//! 2D texture.
|
||||
ETT_2D,
|
||||
|
||||
//! 2D texture with multisampling.
|
||||
ETT_2D_MS,
|
||||
|
||||
//! Cubemap texture.
|
||||
ETT_CUBEMAP
|
||||
};
|
||||
|
|
|
@ -273,6 +273,14 @@ public:
|
|||
virtual ITexture *addRenderTargetTexture(const core::dimension2d<u32> &size,
|
||||
const io::path &name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) = 0;
|
||||
|
||||
//! Adds a multisampled render target texture to the texture cache.
|
||||
/** \param msaa The number of samples to use, values that make sense are > 1.
|
||||
Only works if the driver supports the EVDF_TEXTURE_MULTISAMPLE feature,
|
||||
check via queryFeature.
|
||||
\see addRenderTargetTexture */
|
||||
virtual ITexture *addRenderTargetTextureMs(const core::dimension2d<u32> &size, u8 msaa,
|
||||
const io::path &name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) = 0;
|
||||
|
||||
//! Adds a new render target texture with 6 sides for a cubemap map to the texture cache.
|
||||
/** \param sideLen Length of one cubemap side.
|
||||
\param name A name for the texture. Later calls of getTexture() with this name will return this texture.
|
||||
|
@ -358,6 +366,10 @@ public:
|
|||
//! Remove all render targets.
|
||||
virtual void removeAllRenderTargets() = 0;
|
||||
|
||||
//! Blit contents of one render target to another one.
|
||||
/** This is glBlitFramebuffer in OpenGL. */
|
||||
virtual void blitRenderTarget(IRenderTarget *from, IRenderTarget *to) = 0;
|
||||
|
||||
//! Sets a boolean alpha channel on the texture based on a color key.
|
||||
/** This makes the texture fully transparent at the texels where
|
||||
this color key can be found when using for example draw2DImage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue