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);
130 void setTexture(u8 index,
v2f scale_factor,
const std::string& name, video::ECOLOR_FORMAT format,
bool clear =
false);
133 virtual video::ITexture *
getTexture(u8 index)
override;
210 for (u8 i = start; i <
m_mappings.size(); ++i)
249 virtual video::ITexture *
getTexture(u8 index)
override;
371 T *
own(std::unique_ptr<T> &&
object)
373 T* result =
object.release();
374 m_objects.push_back(std::unique_ptr<RenderPipelineObject>(result));
386 template<
typename T,
typename... Args>
388 return own(std::make_unique<T>(std::forward<Args>(args)...));
400 template<
typename T,
typename... Args>
402 T* result =
own(std::make_unique<T>(std::forward<Args>(args)...));
420 std::vector< std::unique_ptr<RenderPipelineObject> >
m_objects;
Definition pipeline.h:235
bool isConfigured()
Definition pipeline.h:237
void setRenderSource(RenderSource *value)
Definition pipeline.h:238
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.cpp:199
RenderSource * upstream
Definition pipeline.h:251
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition pipeline.cpp:205
Definition pipeline.h:267
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:219
RenderTarget * upstream
Definition pipeline.h:273
bool isConfigured()
Definition pipeline.h:269
void setRenderTarget(RenderTarget *value)
Definition pipeline.h:270
Allows remapping texture indicies in another RenderSource.
Definition pipeline.h:193
void setMapping(u8 index, u8 target_index)
Maps texture index to a different index in the dependent source.
Definition pipeline.h:205
std::vector< u8 > m_mappings
Definition pipeline.h:231
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition pipeline.h:222
RenderSource * m_source
Definition pipeline.h:230
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.h:217
RemappingSource(RenderSource *source)
Definition pipeline.h:195
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:349
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:262
DynamicTarget m_output
Definition pipeline.h:422
RenderTarget * getOutput()
Definition pipeline.cpp:257
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition pipeline.cpp:281
v2f getScale()
Definition pipeline.h:410
void setScale(v2f value)
Definition pipeline.h:411
std::vector< std::unique_ptr< RenderPipelineObject > > m_objects
Definition pipeline.h:420
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition pipeline.cpp:276
RenderSource * getInput()
Definition pipeline.cpp:252
DynamicSource m_input
Definition pipeline.h:421
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:401
virtual void reset(PipelineContext &context) override
Definition pipeline.h:413
v2f scale
Definition pipeline.h:423
RenderStep * addStep(RenderStep *step)
Add a step to the end of the pipeline.
Definition pipeline.h:356
std::vector< RenderStep * > m_pipeline
Definition pipeline.h:419
T * createOwned(Args &&... args)
Create a new object that will be managed by the pipeline.
Definition pipeline.h:387
T * own(std::unique_ptr< T > &&object)
Capture ownership of a dynamically created.
Definition pipeline.h:371
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:280
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:258
core::dimension2du size
Definition pipeline.h:263
virtual void reset(PipelineContext &context) override
Resets the state of the object for the next pipeline iteration.
Definition pipeline.cpp:226
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:211
Dynamically changes render target of another step.
Definition pipeline.h:319
RenderStep * step
Definition pipeline.h:324
RenderTarget * target
Definition pipeline.h:325
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:237
SetRenderTargetStep(RenderStep *step, RenderTarget *target)
Definition pipeline.cpp:232
Definition dynamicshadowsrender.h:39
Swaps two textures in the texture buffer.
Definition pipeline.h:333
TextureBuffer * buffer
Definition pipeline.h:338
u8 texture_b
Definition pipeline.h:340
u8 texture_a
Definition pipeline.h:339
SwapTexturesStep(TextureBuffer *buffer, u8 texture_a, u8 texture_b)
Definition pipeline.cpp:242
virtual void run(PipelineContext &context) override
Runs the step.
Definition pipeline.cpp:247
Targets output to designated texture in texture buffer.
Definition pipeline.h:170
TextureBuffer * buffer
Definition pipeline.h:180
TextureBufferOutput(TextureBuffer *buffer, u8 texture_index)
Definition pipeline.cpp:145
virtual ~TextureBufferOutput() override
Definition pipeline.cpp:157
video::IRenderTarget * render_target
Definition pipeline.h:183
void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition pipeline.cpp:163
static const u8 NO_DEPTH_TEXTURE
Definition pipeline.h:178
std::vector< u8 > texture_map
Definition pipeline.h:181
u8 depth_stencil
Definition pipeline.h:182
video::IVideoDriver * driver
Definition pipeline.h:184
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:92
std::vector< TextureDefinition > m_definitions
Definition pipeline.h:162
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:102
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:163
virtual void reset(PipelineContext &context) override
Definition pipeline.cpp:63
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition pipeline.h:132
video::IVideoDriver * m_driver
Definition pipeline.h:161
void setTexture(u8 index, core::dimension2du size, const std::string &name, video::ECOLOR_FORMAT format, bool clear=false)
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:306
virtual void reset(PipelineContext &) override
Definition pipeline.h:310
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition pipeline.h:309
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition pipeline.h:308
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
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