feat: post-processing effects

This commit is contained in:
MihailRis 2025-04-05 00:41:25 +03:00
parent 22e97b1766
commit ba170035ef
19 changed files with 216 additions and 84 deletions

View file

@ -8,10 +8,19 @@ PostEffect::Param::Param(Type type, Value defValue)
: type(type), defValue(std::move(defValue)) {
}
PostEffect::PostEffect(std::unique_ptr<Shader> shader)
: shader(std::move(shader)) {
PostEffect::PostEffect(
std::unique_ptr<Shader> shader,
std::unordered_map<std::string, Param> params
)
: shader(std::move(shader)), params(std::move(params)) {
}
void PostEffect::use() {
Shader& PostEffect::use() {
shader->use();
shader->uniform1f("u_intensity", intensity);
return *shader;
}
void PostEffect::setIntensity(float value) {
intensity = value;
}