A collection of shaders, render configurations, cameras, and related framebuffers used by a viewport within an ECSWorld.
More...
#include <render_system.hpp>
|
enum class | RenderType : uint8_t { BASIC_3D
, ADDITION
} |
| Enum listing the different rendering pipelines available. More...
|
|
|
void | renderNextTexture () |
| Renders the next debug texture to the render system's final render target.
|
|
void | setRenderProperties (glm::u16vec2 renderDimensions, glm::u16vec2 targetDimensions, const SDL_Rect &viewportDimensions, RenderType renderType) |
| Sets the render properties for this render set.
|
|
std::shared_ptr< Texture > | getCurrentScreenTexture () |
| Returns the currently active debug render texture.
|
|
void | copyAndResize () |
| Uses the resize-stage to scale the rendered image up or down.
|
|
void | addOrAssignRenderSource (const std::string &name, std::shared_ptr< Texture > renderSource) |
| Adds a named render source, presumably intended for use by a render stage in this pipeline.
|
|
void | removeRenderSource (const std::string &name) |
| Removes a named render source.
|
|
void | setSkybox (std::shared_ptr< Texture > skyboxTexture) |
| Sets the texture of the skybox painted to the background of the current scene in the 3D pipeline.
|
|
void | setCamera (EntityID cameraEntity) |
| Sets the entity to be treated as this render set's active camera.
|
|
void | setGamma (float gamma) |
| Sets the gamma value used for gamma correction in the tonemapping stage of the pipeline.
|
|
float | getGamma () |
| Gets the gamma value used in this set's tonemapping-stage.
|
|
void | setExposure (float exposure) |
| Sets the exposure value responsible for determining the behaviour of tonemapping in the tonemapping-stage.
|
|
float | getExposure () |
| Returns the value of exposure set on this render set.
|
|
|
std::size_t | mCurrentScreenTexture {7} |
| The index of the current texture being treated as this object's texture target.
|
|
std::vector< std::shared_ptr< Texture > > | mScreenTextures {} |
| All the debug/screen textures produced by this target.
|
|
EntityID | mActiveCamera {} |
| The ID of the entity treated as this render set's active camera.
|
|
std::shared_ptr< Material > | mLightMaterialHandle {nullptr} |
| Storage for light-related settings.
|
|
std::shared_ptr< GeometryRenderStage > | mGeometryRenderStage { nullptr } |
| Handle to this set's geometry render stage.
|
|
std::shared_ptr< LightingRenderStage > | mLightingRenderStage { nullptr } |
| Handle to this set's lighting render stage.
|
|
std::shared_ptr< BlurRenderStage > | mBlurRenderStage { nullptr } |
| Handle to this set's blur render stage (used for bloom).
|
|
std::shared_ptr< TonemappingRenderStage > | mTonemappingRenderStage { nullptr } |
| Handle to this set's tonemapping and gamma render stage.
|
|
std::shared_ptr< SkyboxRenderStage > | mSkyboxRenderStage { nullptr } |
| Handle to this set's skybox render stage.
|
|
std::shared_ptr< ResizeRenderStage > | mResizeRenderStage { nullptr } |
| Handle to this set's resize render stage.
|
|
std::shared_ptr< ScreenRenderStage > | mScreenRenderStage { nullptr } |
| Handle to this set's screen render stage.
|
|
std::shared_ptr< AdditionRenderStage > | mAdditionRenderStage { nullptr } |
| Handle to this set's addition render stage.
|
|
std::map< std::string, std::shared_ptr< Texture > > | mRenderSources {} |
| Textures designated as sources for this render set.
|
|
RenderType | mRenderType { RenderType::BASIC_3D } |
| An ID representing the type of pipeline used in this set.
|
|
float | mGamma { 2.f } |
| This sets presently configured gamma correction value.
|
|
float | mExposure { 1.f } |
| This sets presently configured exposure value.
|
|
bool | mRerendered { true } |
| A marker for when the 3D pipeline or the addition pipeline has been rerendered, and a corresponding screen or resize step is required.
|
|
A collection of shaders, render configurations, cameras, and related framebuffers used by a viewport within an ECSWorld.
These render sets have in common with each other opaque geometry, light sources, a skybox, and a common uniform buffer for storing camera matrices.
◆ RenderType
Enum listing the different rendering pipelines available.
- Todo
- Split this out into different configuration files for the render system instead of their current "if-else" structure.
◆ addOrAssignRenderSource()
void RenderSet::addOrAssignRenderSource |
( |
const std::string & | name, |
|
|
std::shared_ptr< Texture > | renderSource ) |
Adds a named render source, presumably intended for use by a render stage in this pipeline.
- Parameters
-
name | The name of the render source. |
renderSource | A handle to the texture used as render source. |
◆ getCurrentScreenTexture()
std::shared_ptr< Texture > RenderSet::getCurrentScreenTexture |
( |
| ) |
|
Returns the currently active debug render texture.
- Returns
- std::shared_ptr<Texture> A reference to the currently active debug render texture.
◆ getExposure()
float RenderSet::getExposure |
( |
| ) |
|
Returns the value of exposure set on this render set.
- Returns
- float This set's exposure.
◆ getGamma()
float RenderSet::getGamma |
( |
| ) |
|
Gets the gamma value used in this set's tonemapping-stage.
- Returns
- float This set's gamma value.
◆ removeRenderSource()
void RenderSet::removeRenderSource |
( |
const std::string & | name | ) |
|
Removes a named render source.
- Parameters
-
name | The name of the render source removed. |
◆ renderNextTexture()
void RenderSet::renderNextTexture |
( |
| ) |
|
Renders the next debug texture to the render system's final render target.
Mainly a debug option.
◆ setCamera()
void RenderSet::setCamera |
( |
EntityID | cameraEntity | ) |
|
Sets the entity to be treated as this render set's active camera.
- Parameters
-
cameraEntity | An entity which fulfils CameraSystem prerequisites. |
◆ setExposure()
void RenderSet::setExposure |
( |
float | exposure | ) |
|
Sets the exposure value responsible for determining the behaviour of tonemapping in the tonemapping-stage.
- Parameters
-
exposure | The new exposure value, similar to real-world camera exposure. |
◆ setGamma()
void RenderSet::setGamma |
( |
float | gamma | ) |
|
Sets the gamma value used for gamma correction in the tonemapping stage of the pipeline.
- Parameters
-
gamma | The new gamma value. |
◆ setRenderProperties()
void RenderSet::setRenderProperties |
( |
glm::u16vec2 | renderDimensions, |
|
|
glm::u16vec2 | targetDimensions, |
|
|
const SDL_Rect & | viewportDimensions, |
|
|
RenderType | renderType ) |
Sets the render properties for this render set.
Creates and reconfigures all the shader stages in the render pipeline with the properties specified.
- Parameters
-
renderDimensions | The texture dimensions used for all non resize-stage and screen-stage framebuffers. |
targetDimensions | The texture dimensions used by the resize-stage and screen-stage framebuffers. |
viewportDimensions | The sub-region of the pipeline target dimensions rendered to. |
renderType | The type of pipeline desired for this RenderSet. |
TODO: remove this hacky render debug system, replace it with something that can be configured from file
◆ setSkybox()
void ToyMaker::RenderSet::setSkybox |
( |
std::shared_ptr< Texture > | skyboxTexture | ) |
|
Sets the texture of the skybox painted to the background of the current scene in the 3D pipeline.
- Parameters
-
skyboxTexture | An appropriately formatted cubemap texture. |
The documentation for this struct was generated from the following files: