Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
secondstage.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4Copyright (C) 2017 numzero, Lobachevskiy Vitaliy <numzer0@yandex.ru>
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation; either version 2.1 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License along
17with this program; if not, write to the Free Software Foundation, Inc.,
1851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#pragma once
22#include "stereo.h"
23#include "pipeline.h"
24
29{
30public:
37 PostProcessingStep(u32 shader_id, const std::vector<u8> &texture_map);
38
39
40 void setRenderSource(RenderSource *source) override;
41 void setRenderTarget(RenderTarget *target) override;
42 void reset(PipelineContext &context) override;
43 void run(PipelineContext &context) override;
44
51 void setBilinearFilter(u8 index, bool value);
52private:
54 std::vector<u8> texture_map;
55 RenderSource *source { nullptr };
56 RenderTarget *target { nullptr };
57 video::SMaterial material;
58
59 void configureMaterial();
60};
61
62RenderStep *addPostProcessing(RenderPipeline *pipeline, RenderStep *previousStep, v2f scale, Client *client);
Definition: client.h:119
Step to apply post-processing filter to the rendered image.
Definition: secondstage.h:29
u32 shader_id
Definition: secondstage.h:53
void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition: secondstage.cpp:49
void setBilinearFilter(u8 index, bool value)
Configure bilinear filtering for a specific texture layer.
Definition: secondstage.cpp:92
void configureMaterial()
Definition: secondstage.cpp:35
RenderTarget * target
Definition: secondstage.h:56
RenderSource * source
Definition: secondstage.h:55
std::vector< u8 > texture_map
Definition: secondstage.h:54
video::SMaterial material
Definition: secondstage.h:57
void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition: secondstage.cpp:54
void reset(PipelineContext &context) override
Definition: secondstage.cpp:59
void run(PipelineContext &context) override
Runs the step.
Definition: secondstage.cpp:63
Render Pipeline provides a flexible way to execute rendering steps in the engine.
Definition: pipeline.h:357
Represents a source of rendering information such as textures.
Definition: pipeline.h:68
Base class for rendering steps in the pipeline.
Definition: pipeline.h:288
Represents a render target (screen or framebuffer)
Definition: pipeline.h:86
core::vector2d< f32 > v2f
Definition: irr_v2d.h:26
Definition: activeobjectmgr.cpp:26
RenderStep * addPostProcessing(RenderPipeline *pipeline, RenderStep *previousStep, v2f scale, Client *client)
Definition: secondstage.cpp:99
Definition: pipeline.h:35