mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
refactor GLSLExtension.cpp & add 'param' shader preprocessor directive & add PostEffect class (WIP)
This commit is contained in:
parent
531334f059
commit
1feee3a809
8 changed files with 263 additions and 97 deletions
29
src/graphics/core/PostEffect.hpp
Normal file
29
src/graphics/core/PostEffect.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <unordered_map>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
class Shader;
|
||||
|
||||
class PostEffect {
|
||||
public:
|
||||
struct Param {
|
||||
enum class Type { FLOAT, VEC2, VEC3, VEC4 };
|
||||
using Value = std::variant<float, glm::vec2, glm::vec3, glm::vec4>;
|
||||
|
||||
Type type;
|
||||
|
||||
Param();
|
||||
Param(Type type);
|
||||
};
|
||||
|
||||
PostEffect(std::unique_ptr<Shader> shader);
|
||||
|
||||
void use();
|
||||
private:
|
||||
std::unique_ptr<Shader> shader;
|
||||
std::unordered_map<std::string, Param> params;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue