128 void setTexture(u8 index, core::dimension2du size,
const std::string& name, video::ECOLOR_FORMAT format,
bool clear =
false);
138 void setTexture(u8 index,
v2f scale_factor,
const std::string& name, video::ECOLOR_FORMAT format,
bool clear =
false);
141 virtual video::ITexture *
getTexture(u8 index)
override;
218 for (u8 i = start; i <
m_mappings.size(); ++i)
257 virtual video::ITexture *
getTexture(u8 index)
override;
379 T *
own(std::unique_ptr<T> &&
object)
381 T* result =
object.release();
382 m_objects.push_back(std::unique_ptr<RenderPipelineObject>(result));
394 template<
typename T,
typename... Args>
396 return own(std::make_unique<T>(std::forward<Args>(args)...));
408 template<
typename T,
typename... Args>
410 T* result =
own(std::make_unique<T>(std::forward<Args>(args)...));
428 std::vector< std::unique_ptr<RenderPipelineObject> >
m_objects;
Definition: pipeline.h:243
bool isConfigured()
Definition: pipeline.h:245
void setRenderSource(RenderSource *value)
Definition: pipeline.h:246
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition: pipeline.cpp:214
RenderSource * upstream
Definition: pipeline.h:259
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition: pipeline.cpp:220
Definition: pipeline.h:275
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition: pipeline.cpp:234
RenderTarget * upstream
Definition: pipeline.h:281
bool isConfigured()
Definition: pipeline.h:277
void setRenderTarget(RenderTarget *value)
Definition: pipeline.h:278
Allows remapping texture indicies in another RenderSource.
Definition: pipeline.h:201
void setMapping(u8 index, u8 target_index)
Maps texture index to a different index in the dependent source.
Definition: pipeline.h:213
std::vector< u8 > m_mappings
Definition: pipeline.h:239
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition: pipeline.h:230
RenderSource * m_source
Definition: pipeline.h:238
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition: pipeline.h:225
RemappingSource(RenderSource *source)
Definition: pipeline.h:203
Base object that can be owned by RenderPipeline.
Definition: pipeline.h:58
virtual void reset(PipelineContext &context)
Definition: pipeline.h:61
virtual ~RenderPipelineObject()=default
Render Pipeline provides a flexible way to execute rendering steps in the engine.
Definition: pipeline.h:357
virtual void run(PipelineContext &context) override
Runs the step.
Definition: pipeline.cpp:277
DynamicTarget m_output
Definition: pipeline.h:430
RenderTarget * getOutput()
Definition: pipeline.cpp:272
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition: pipeline.cpp:296
v2f getScale()
Definition: pipeline.h:418
void setScale(v2f value)
Definition: pipeline.h:419
std::vector< std::unique_ptr< RenderPipelineObject > > m_objects
Definition: pipeline.h:428
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition: pipeline.cpp:291
RenderSource * getInput()
Definition: pipeline.cpp:267
DynamicSource m_input
Definition: pipeline.h:429
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:409
virtual void reset(PipelineContext &context) override
Definition: pipeline.h:421
v2f scale
Definition: pipeline.h:431
RenderStep * addStep(RenderStep *step)
Add a step to the end of the pipeline.
Definition: pipeline.h:364
std::vector< RenderStep * > m_pipeline
Definition: pipeline.h:427
T * createOwned(Args &&... args)
Create a new object that will be managed by the pipeline.
Definition: pipeline.h:395
T * own(std::unique_ptr< T > &&object)
Capture ownership of a dynamically created.
Definition: pipeline.h:379
Represents a source of rendering information such as textures.
Definition: pipeline.h:68
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:288
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:86
bool m_clear
Definition: pipeline.h:106
virtual void activate(PipelineContext &context)
Activate the render target and configure OpenGL state for the output.
Definition: pipeline.h:92
virtual void reset(PipelineContext &context) override
Resets the state of the object for the next pipeline iteration.
Definition: pipeline.h:100
Implements direct output to screen framebuffer.
Definition: pipeline.h:266
core::dimension2du size
Definition: pipeline.h:271
virtual void reset(PipelineContext &context) override
Resets the state of the object for the next pipeline iteration.
Definition: pipeline.cpp:241
virtual void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition: pipeline.cpp:226
Dynamically changes render target of another step.
Definition: pipeline.h:327
RenderStep * step
Definition: pipeline.h:332
RenderTarget * target
Definition: pipeline.h:333
virtual void run(PipelineContext &context) override
Runs the step.
Definition: pipeline.cpp:252
Definition: dynamicshadowsrender.h:53
Swaps two textures in the texture buffer.
Definition: pipeline.h:341
TextureBuffer * buffer
Definition: pipeline.h:346
u8 texture_b
Definition: pipeline.h:348
u8 texture_a
Definition: pipeline.h:347
virtual void run(PipelineContext &context) override
Runs the step.
Definition: pipeline.cpp:262
Targets output to designated texture in texture buffer.
Definition: pipeline.h:178
TextureBuffer * buffer
Definition: pipeline.h:188
virtual ~TextureBufferOutput() override
Definition: pipeline.cpp:172
video::IRenderTarget * render_target
Definition: pipeline.h:191
void activate(PipelineContext &context) override
Activate the render target and configure OpenGL state for the output.
Definition: pipeline.cpp:178
static const u8 NO_DEPTH_TEXTURE
Definition: pipeline.h:186
std::vector< u8 > texture_map
Definition: pipeline.h:189
u8 depth_stencil
Definition: pipeline.h:190
video::IVideoDriver * driver
Definition: pipeline.h:192
Texture buffer represents a framebuffer with a multiple attached textures.
Definition: pipeline.h:115
void swapTextures(u8 texture_a, u8 texture_b)
Definition: pipeline.cpp:107
std::vector< TextureDefinition > m_definitions
Definition: pipeline.h:170
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:117
static const u8 NO_DEPTH_TEXTURE
Definition: pipeline.h:145
virtual video::ITexture * getTexture(u8 index) override
Get a texture by index.
Definition: pipeline.cpp:36
virtual ~TextureBuffer() override
Definition: pipeline.cpp:29
core::array< video::ITexture * > m_textures
Definition: pipeline.h:171
virtual void reset(PipelineContext &context) override
Definition: pipeline.cpp:78
virtual u8 getTextureCount() override
Return the number of textures in the source.
Definition: pipeline.h:140
video::IVideoDriver * m_driver
Definition: pipeline.h:169
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:44
Provides default empty implementation of supporting methods in a rendering step.
Definition: pipeline.h:314
virtual void reset(PipelineContext &) override
Definition: pipeline.h:318
virtual void setRenderTarget(RenderTarget *target) override
Assigned render target to this step.
Definition: pipeline.h:317
virtual void setRenderSource(RenderSource *source) override
Assigns render source to this step.
Definition: pipeline.h:316
core::vector2d< f32 > v2f
Definition: irr_v2d.h:26
core::vector2d< u32 > v2u32
Definition: irr_v2d.h:29
Definition: activeobjectmgr.cpp:26
Definition: pipeline.h:35
Hud * hud
Definition: pipeline.h:43
bool draw_wield_tool
Definition: pipeline.h:49
bool show_hud
Definition: pipeline.h:48
video::SColor clear_color
Definition: pipeline.h:45
bool draw_crosshair
Definition: pipeline.h:50
ShadowRenderer * shadow_renderer
Definition: pipeline.h:44
IrrlichtDevice * device
Definition: pipeline.h:41
PipelineContext(IrrlichtDevice *_device, Client *_client, Hud *_hud, ShadowRenderer *_shadow_renderer, video::SColor _color, v2u32 _target_size)
Definition: pipeline.h:36
Client * client
Definition: pipeline.h:42
v2u32 target_size
Definition: pipeline.h:46
Definition: pipeline.h:148
bool valid
Definition: pipeline.h:149
core::dimension2du size
Definition: pipeline.h:154
bool dirty
Definition: pipeline.h:151
video::ECOLOR_FORMAT format
Definition: pipeline.h:156
v2f scale_factor
Definition: pipeline.h:153
std::string name
Definition: pipeline.h:155
bool clear
Definition: pipeline.h:152
bool fixed_size
Definition: pipeline.h:150