diff --git a/opengl-test-two/bin/Debug/opengl-test-two.exe b/opengl-test-two/bin/Debug/opengl-test-two.exe index 9abe712..c259a5b 100644 Binary files a/opengl-test-two/bin/Debug/opengl-test-two.exe and b/opengl-test-two/bin/Debug/opengl-test-two.exe differ diff --git a/opengl-test-two/main.cpp b/opengl-test-two/main.cpp index 5365d19..4125152 100644 --- a/opengl-test-two/main.cpp +++ b/opengl-test-two/main.cpp @@ -261,7 +261,8 @@ int main(int argc, char* args[]) { printf("textureLocation: %d\n", textureLocation); printf("widthLocation: %d\n", widthLocation); printf("heigthLocation: %d\n", heigthLocation); - printf("Width: %f", 1.0f/textw); + printf("Width: %f\n", 1.0f/textw); + printf("Height: %f\n", 1.0f/texth); diff --git a/opengl-test-two/opengl-test-two.depend b/opengl-test-two/opengl-test-two.depend index 939c5bb..d81bcc1 100644 --- a/opengl-test-two/opengl-test-two.depend +++ b/opengl-test-two/opengl-test-two.depend @@ -2,7 +2,7 @@ 1385320478 source:d:\owncloud\documents\programmierung\cpp\opengl-test-two\main.cpp -1473104829 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\main.cpp +1473106263 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\main.cpp diff --git a/opengl-test-two/trimap.fragmentshader b/opengl-test-two/trimap.fragmentshader index 6d60909..a098a00 100644 --- a/opengl-test-two/trimap.fragmentshader +++ b/opengl-test-two/trimap.fragmentshader @@ -8,8 +8,8 @@ out vec3 color; // Values that stay constant for the whole mesh. uniform sampler2D myTextureSampler; -uniform float pixWidth; -uniform float pixHeight; +//uniform float pixWidth; +//uniform float pixHeight; @@ -22,10 +22,11 @@ int UNSET = -1; vec3 getColor(vec2 uvCoord) { - return texture(myTextureSampler, UV).rgb; + return texture(myTextureSampler, uvCoord).rgb; } bool isBackground(vec3 c) { + // 49,206, 11 if (all( lessThanEqual(c, vec3(51.0f/255.0f, 208.0f/255.0f, 13.0f/255.0f))) && all(greaterThanEqual(c, vec3(47.0f/255.0f, 204.0f/255.0f, 9.0f/255.0f))) ) { @@ -36,13 +37,13 @@ bool isBackground(vec3 c) { } void main(){ + float pixWidth = 0.001174f; + float pixHeight = 0.002083f; int status = UNSET; float pw = pixWidth; float ph = pixHeight; - // 49,206, 11 // Output color = color of the texture at the specified UV - color = getColor(UV); for(int w=-5;w<=5;w++){ for(int h=-5;h<=5;h++){ if (w+h==-10) { // first pixel