Framebuffer working; Trimap renders to FB; Refinem. use Trimap to Screen

This commit is contained in:
Caesar2011
2016-09-12 18:18:32 +02:00
parent 7588c0d27b
commit a1c76d1e7f
8 changed files with 165 additions and 18 deletions

View File

@@ -4,11 +4,11 @@
in vec2 UV;
// Ouput data
out vec3 color;
layout(location = 0) out vec3 color;
//out vec3 color;
// Values that stay constant for the whole mesh.
uniform sampler2D myTextureSampler;
uniform sampler2D myTextureSampler2;
// Relative width/height of a pixel
uniform float pixWidth;
@@ -23,7 +23,7 @@ int UNSET = -1;
vec3 getColor(vec2 uvCoord) {
return texture(myTextureSampler2, uvCoord).rgb;
return texture(myTextureSampler, uvCoord).rgb;
}
bool isBackground(vec3 c) {
@@ -70,10 +70,10 @@ void main(){
}
if (status == IS_BACKGROUND) {
color = vec3(1.0f, 0.0f, 0.0f);
color = vec3(0.0f);
} else if (status == IS_FOREGROUND) {
color = vec3(0.0f, 1.0f, 0.0f);
color = vec3(1.0f);
} else {
color = vec3(0.0f, 0.0f, 1.0f);
color = vec3(0.5f);
}
}