7#include <IrrlichtDevice.h>
8#include <IVideoDriver.h>
120 void setTexture(u8 index, core::dimension2du size,
const std::string& name, video::ECOLOR_FORMAT format,
bool clear =
false, u8 msaa = 0);
130 void setTexture(u8 index,
v2f scale_factor,
const std::string& name, video::ECOLOR_FORMAT format,
bool clear =
false, u8 msaa = 0);
133 virtual video::ITexture *
getTexture(u8 index)
override;
214 for (u8 i = start; i <
m_mappings.size(); ++i)
253 virtual video::ITexture *
getTexture(u8 index)
override;
375 T *
own(std::unique_ptr<T> &&
object)
377 T* result =
object.release();
378 m_objects.push_back(std::unique_ptr<RenderPipelineObject>(result));
390 template<
typename T,
typename... Args>
392 return own(std::make_unique<T>(std::forward<Args>(args)...));
404 template<
typename T,
typename... Args>
406 T* result =
own(std::make_unique<T>(std::forward<Args>(args)...));
424 std::vector< std::unique_ptr<RenderPipelineObject> >
m_objects;
Definition pipeline.h:239
bool isConfigured()
Definition pipeline.h:241
void setRenderSource(RenderSource *value)
Definition pipeline.h:242
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.cpp:206
RenderSource * upstream
Definition pipeline.h:255
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition pipeline.cpp:212
Definition pipeline.h:271
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:226
RenderTarget * upstream
Definition pipeline.h:277
bool isConfigured()
Definition pipeline.h:273
void setRenderTarget(RenderTarget *value)
Definition pipeline.h:274
Allows remapping texture indicies in another RenderSource.
Definition pipeline.h:197
void setMapping(u8 index, u8 target_index)
Maps texture index to a different index in the dependent source.
Definition pipeline.h:209
std::vector< u8 > m_mappings
Definition pipeline.h:235
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition pipeline.h:226
RenderSource * m_source
Definition pipeline.h:234
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.h:221
RemappingSource(RenderSource *source)
Definition pipeline.h:199
Base object that can be owned by RenderPipeline.
Definition pipeline.h:50
virtual void reset(PipelineContext &context)
Definition pipeline.h:53
virtual ~RenderPipelineObject()=default
Render Pipeline provides a flexible way to execute rendering steps in the engine.
Definition pipeline.h:353
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:269
DynamicTarget m_output
Definition pipeline.h:426
RenderTarget * getOutput()
Definition pipeline.cpp:264
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition pipeline.cpp:288
v2f getScale()
Definition pipeline.h:414
void setScale(v2f value)
Definition pipeline.h:415
std::vector< std::unique_ptr< RenderPipelineObject > > m_objects
Definition pipeline.h:424
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition pipeline.cpp:283
RenderSource * getInput()
Definition pipeline.cpp:259
DynamicSource m_input
Definition pipeline.h:425
T * addStep(Args &&... args)
Create and add a step managed by the pipeline and return a pointer to the step for further configurat...
Definition pipeline.h:405
virtual void reset(PipelineContext &context) override
Definition pipeline.h:417
v2f scale
Definition pipeline.h:427
RenderStep * addStep(RenderStep *step)
Add a step to the end of the pipeline.
Definition pipeline.h:360
std::vector< RenderStep * > m_pipeline
Definition pipeline.h:423
T * createOwned(Args &&... args)
Create a new object that will be managed by the pipeline.
Definition pipeline.h:391
T * own(std::unique_ptr< T > &&object)
Capture ownership of a dynamically created.
Definition pipeline.h:375
Represents a source of rendering information such as textures.
Definition pipeline.h:60
virtual u8 getTextureCount()=0
Return the number of textures in the source.
virtual video::ITexture * getTexture(u8 index)=0
Get a texture by index.
Base class for rendering steps in the pipeline.
Definition pipeline.h:284
virtual void run(PipelineContext &context)=0
Runs the step.
virtual void setRenderSource(RenderSource *source)=0
Assigns render source to this step.
virtual void setRenderTarget(RenderTarget *target)=0
Assigned render target to this step.
Represents a render target (screen or framebuffer)
Definition pipeline.h:78
bool m_clear
Definition pipeline.h:98
virtual void activate(PipelineContext &context)
Activate the render target and configure OpenGL state for the output.
Definition pipeline.h:84
virtual void reset(PipelineContext &context) override
Resets the state of the object for the next pipeline iteration.
Definition pipeline.h:92
Implements direct output to screen framebuffer.
Definition pipeline.h:262
core::dimension2du size
Definition pipeline.h:267
virtual void reset(PipelineContext &context) override
Resets the state of the object for the next pipeline iteration.
Definition pipeline.cpp:233
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:218
Dynamically changes render target of another step.
Definition pipeline.h:323
RenderStep * step
Definition pipeline.h:328
RenderTarget * target
Definition pipeline.h:329
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:244
SetRenderTargetStep(RenderStep *step, RenderTarget *target)
Definition pipeline.cpp:239
Definition dynamicshadowsrender.h:39
Swaps two textures in the texture buffer.
Definition pipeline.h:337
TextureBuffer * buffer
Definition pipeline.h:342
u8 texture_b
Definition pipeline.h:344
u8 texture_a
Definition pipeline.h:343
SwapTexturesStep(TextureBuffer *buffer, u8 texture_a, u8 texture_b)
Definition pipeline.cpp:249
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:254
Targets output to designated texture in texture buffer.
Definition pipeline.h:171
video::IRenderTarget * getIrrRenderTarget(PipelineContext &context)
Definition pipeline.cpp:200
TextureBuffer * buffer
Definition pipeline.h:184
TextureBufferOutput(TextureBuffer *buffer, u8 texture_index)
Definition pipeline.cpp:153
virtual ~TextureBufferOutput() override
Definition pipeline.cpp:165
video::IRenderTarget * render_target
Definition pipeline.h:187
void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:171
static const u8 NO_DEPTH_TEXTURE
Definition pipeline.h:182
std::vector< u8 > texture_map
Definition pipeline.h:185
u8 depth_stencil
Definition pipeline.h:186
video::IVideoDriver * driver
Definition pipeline.h:188
Texture buffer represents a framebuffer with a multiple attached textures.
Definition pipeline.h:107
void swapTextures(u8 texture_a, u8 texture_b)
Definition pipeline.cpp:94
std::vector< TextureDefinition > m_definitions
Definition pipeline.h:163
bool ensureTexture(video::ITexture **textureSlot, const TextureDefinition &definition, PipelineContext &context)
Make sure the texture in the given slot matches the texture definition given the current context.
Definition pipeline.cpp:104
static const u8 NO_DEPTH_TEXTURE
Definition pipeline.h:137
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition pipeline.cpp:21
virtual ~TextureBuffer() override
Definition pipeline.cpp:14
core::array< video::ITexture * > m_textures
Definition pipeline.h:164
virtual void reset(PipelineContext &context) override
Definition pipeline.cpp:65
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.h:132
video::IVideoDriver * m_driver
Definition pipeline.h:162
void setTexture(u8 index, core::dimension2du size, const std::string &name, video::ECOLOR_FORMAT format, bool clear=false, u8 msaa=0)
Configure fixed-size texture for the specific index.
Definition pipeline.cpp:29
Provides default empty implementation of supporting methods in a rendering step.
Definition pipeline.h:310
virtual void reset(PipelineContext &) override
Definition pipeline.h:314
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition pipeline.h:313
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition pipeline.h:312
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector2d< u32 > v2u32
Definition irr_v2d.h:14
Definition activeobjectmgr.cpp:11
Definition clientmap.h:35
Hud * hud
Definition pipeline.h:35
bool draw_wield_tool
Definition pipeline.h:41
bool show_hud
Definition pipeline.h:40
video::SColor clear_color
Definition pipeline.h:37
bool draw_crosshair
Definition pipeline.h:42
ShadowRenderer * shadow_renderer
Definition pipeline.h:36
IrrlichtDevice * device
Definition pipeline.h:33
PipelineContext(IrrlichtDevice *_device, Client *_client, Hud *_hud, ShadowRenderer *_shadow_renderer, video::SColor _color, v2u32 _target_size)
Definition pipeline.h:28
Client * client
Definition pipeline.h:34
v2u32 target_size
Definition pipeline.h:38
Definition pipeline.h:140
bool valid
Definition pipeline.h:141
u8 msaa
Definition pipeline.h:149
core::dimension2du size
Definition pipeline.h:146
bool dirty
Definition pipeline.h:143
video::ECOLOR_FORMAT format
Definition pipeline.h:148
v2f scale_factor
Definition pipeline.h:145
std::string name
Definition pipeline.h:147
bool clear
Definition pipeline.h:144
bool fixed_size
Definition pipeline.h:142