Added background to refinement shader
This commit is contained in:
@@ -9,6 +9,7 @@ out vec3 color;
|
||||
// Values that stay constant for the whole mesh.
|
||||
uniform sampler2D trimap;
|
||||
uniform sampler2D foreground;
|
||||
uniform sampler2D background;
|
||||
|
||||
|
||||
int IS_BACKGROUND = 0;
|
||||
@@ -24,6 +25,10 @@ vec3 getForeColor(vec2 uvCoord) {
|
||||
return texture(foreground, uvCoord).rgb;
|
||||
}
|
||||
|
||||
vec3 getBackColor(vec2 uvCoord) {
|
||||
return texture(background, uvCoord).rgb;
|
||||
}
|
||||
|
||||
int getState(vec3 c) {
|
||||
if (all(lessThanEqual(c, vec3(0.2f)))) {
|
||||
return IS_BACKGROUND;
|
||||
@@ -42,5 +47,9 @@ void main(){
|
||||
|
||||
if (status==IS_FOREGROUND) {
|
||||
color = getForeColor(UV).rgb;
|
||||
} else if (status==IS_BACKGROUND) {
|
||||
color = getBackColor(UV).rgb;
|
||||
} else {
|
||||
// render undefined area
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user