Tri-Map working now; output of every state in a different color
This commit is contained in:
Binary file not shown.
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
1385320478 source:d:\owncloud\documents\programmierung\cpp\opengl-test-two\main.cpp
|
||||
<iostream>
|
||||
|
||||
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
|
||||
<GL/glew.h>
|
||||
<GLFW/glfw3.h>
|
||||
<SDL2/SDL.h>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user