mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
src/graphics moved to src/graphics/core
This commit is contained in:
parent
ba762584a7
commit
b56408a202
63 changed files with 156 additions and 147 deletions
|
|
@ -1,37 +0,0 @@
|
|||
#ifndef GRAPHICS_POST_PROCESSING_H_
|
||||
#define GRAPHICS_POST_PROCESSING_H_
|
||||
|
||||
#include "Viewport.h"
|
||||
#include "GfxContext.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Mesh;
|
||||
class Shader;
|
||||
class Framebuffer;
|
||||
|
||||
/// @brief Framebuffer with blitting with shaders.
|
||||
/// @attention Current implementation does not support multiple render passes
|
||||
/// for multiple effects. Will be implemented in v0.21
|
||||
class PostProcessing {
|
||||
/// @brief Main framebuffer (lasy field)
|
||||
std::unique_ptr<Framebuffer> fbo;
|
||||
/// @brief Fullscreen quad mesh as the post-processing canvas
|
||||
std::unique_ptr<Mesh> quadMesh;
|
||||
public:
|
||||
PostProcessing();
|
||||
~PostProcessing();
|
||||
|
||||
/// @brief Prepare and bind framebuffer
|
||||
/// @param context graphics context will be modified
|
||||
void use(GfxContext& context);
|
||||
|
||||
/// @brief Render fullscreen quad using the passed shader
|
||||
/// with framebuffer texture bound
|
||||
/// @param context graphics context
|
||||
/// @param screenShader shader used for fullscreen quad
|
||||
/// @throws std::runtime_error if use(...) wasn't called before
|
||||
void render(const GfxContext& context, Shader* screenShader);
|
||||
};
|
||||
|
||||
#endif // GRAPHICS_POST_PROCESSING_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue