mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +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
|
@ -117,7 +117,7 @@ public:
|
|||
* @param name unique name of the texture
|
||||
* @param format color format
|
||||
*/
|
||||
void setTexture(u8 index, core::dimension2du size, const std::string& name, video::ECOLOR_FORMAT format, bool clear = false);
|
||||
void setTexture(u8 index, core::dimension2du size, const std::string& name, video::ECOLOR_FORMAT format, bool clear = false, u8 msaa = 0);
|
||||
|
||||
/**
|
||||
* Configure relative-size texture for the specific index
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
* @param name unique name of the texture
|
||||
* @param format color format
|
||||
*/
|
||||
void setTexture(u8 index, v2f scale_factor, const std::string& name, video::ECOLOR_FORMAT format, bool clear = false);
|
||||
void setTexture(u8 index, v2f scale_factor, const std::string& name, video::ECOLOR_FORMAT format, bool clear = false, u8 msaa = 0);
|
||||
|
||||
virtual u8 getTextureCount() override { return m_textures.size(); }
|
||||
virtual video::ITexture *getTexture(u8 index) override;
|
||||
|
@ -146,6 +146,7 @@ private:
|
|||
core::dimension2du size;
|
||||
std::string name;
|
||||
video::ECOLOR_FORMAT format;
|
||||
u8 msaa;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -174,6 +175,9 @@ public:
|
|||
TextureBufferOutput(TextureBuffer *buffer, const std::vector<u8> &texture_map, u8 depth_stencil);
|
||||
virtual ~TextureBufferOutput() override;
|
||||
void activate(PipelineContext &context) override;
|
||||
|
||||
video::IRenderTarget *getIrrRenderTarget(PipelineContext &context);
|
||||
|
||||
private:
|
||||
static const u8 NO_DEPTH_TEXTURE = 255;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue