diff options
author | x2048 <codeforsmile@gmail.com> | 2023-01-06 22:33:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 22:33:25 +0100 |
commit | 6d45c243f85942b20dab58753e735ec89a68f710 (patch) | |
tree | bfe6207d73d1b111af82ea9e5794bdaac4ce26e3 /src/client/render/pipeline.cpp | |
parent | 2715cc8bf68a2cc8cd583cd5b0bb732ee13a1b49 (diff) | |
download | minetest-6d45c243f85942b20dab58753e735ec89a68f710.tar.xz |
Add dynamic exposure correction (#12959)
* Add uniform for frame delta time
* Adjust exposure in logarithmic (EV) space
* Add network support and LUA API
* Add testing mod
Diffstat (limited to 'src/client/render/pipeline.cpp')
-rw-r--r-- | src/client/render/pipeline.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp index 13898f8a4..cc275a7ef 100644 --- a/src/client/render/pipeline.cpp +++ b/src/client/render/pipeline.cpp @@ -101,6 +101,16 @@ void TextureBuffer::reset(PipelineContext &context) RenderSource::reset(context); } +void TextureBuffer::swapTextures(u8 texture_a, u8 texture_b) +{ + assert(m_definitions[texture_a].valid && m_definitions[texture_b].valid); + + video::ITexture *temp = m_textures[texture_a]; + m_textures[texture_a] = m_textures[texture_b]; + m_textures[texture_b] = temp; +} + + bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefinition& definition, PipelineContext &context) { bool modify; @@ -230,6 +240,16 @@ void SetRenderTargetStep::run(PipelineContext &context) step->setRenderTarget(target); } +SwapTexturesStep::SwapTexturesStep(TextureBuffer *_buffer, u8 _texture_a, u8 _texture_b) + : buffer(_buffer), texture_a(_texture_a), texture_b(_texture_b) +{ +} + +void SwapTexturesStep::run(PipelineContext &context) +{ + buffer->swapTextures(texture_a, texture_b); +} + RenderSource *RenderPipeline::getInput() { return &m_input; |