New Shader Image Processing

Cleanup shaders and add image processing shader for source
This commit is contained in:
brunoherbelin
2020-04-25 23:58:49 +02:00
parent 0e24d1a083
commit 551acf25b9
24 changed files with 1009 additions and 65 deletions

View File

@@ -1,6 +1,8 @@
#ifndef IMAGEPROCESSINGSHADER_H
#define IMAGEPROCESSINGSHADER_H
#include <glm/glm.hpp>
#include "Shader.h"
class ImageProcessingShader : public Shader
@@ -8,15 +10,37 @@ class ImageProcessingShader : public Shader
public:
ImageProcessingShader();
virtual ~ImageShader() {}
virtual ~ImageProcessingShader() {}
virtual void use();
virtual void reset();
virtual void accept(Visitor& v);
float brightness;
float contrast;
float stipple;
// textures resolution
glm::vec3 iChannelResolution[2];
// color effects
float brightness; // [-1 1]
float contrast; // [-1 1]
float saturation; // [-1 1]
float hueshift; // [0 1]
float threshold; // [0 1]
float lumakey; // [0 1]
// gamma
glm::vec4 gamma;
glm::vec4 levels;
// discrete operations
int nbColors;
int invert;
// chroma key
glm::vec4 chromakey;
float chromadelta;
// filter
// [0] No filter
// [1 4] 4 x kernel operations; Blur, Sharpen, Edge, Emboss
// [5 10] 6 x convolutions: erosion 3, 5, 7, dilation 3, 5, 7
int filter;
};