Framebuffer working; Trimap renders to FB; Refinem. use Trimap to Screen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user