mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
feat: post-processing effects
This commit is contained in:
parent
22e97b1766
commit
ba170035ef
19 changed files with 216 additions and 84 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue