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("textureLocation: %d\n", textureLocation);
|
||||||
printf("widthLocation: %d\n", widthLocation);
|
printf("widthLocation: %d\n", widthLocation);
|
||||||
printf("heigthLocation: %d\n", heigthLocation);
|
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
|
1385320478 source:d:\owncloud\documents\programmierung\cpp\opengl-test-two\main.cpp
|
||||||
<iostream>
|
<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>
|
<GL/glew.h>
|
||||||
<GLFW/glfw3.h>
|
<GLFW/glfw3.h>
|
||||||
<SDL2/SDL.h>
|
<SDL2/SDL.h>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ out vec3 color;
|
|||||||
|
|
||||||
// Values that stay constant for the whole mesh.
|
// Values that stay constant for the whole mesh.
|
||||||
uniform sampler2D myTextureSampler;
|
uniform sampler2D myTextureSampler;
|
||||||
uniform float pixWidth;
|
//uniform float pixWidth;
|
||||||
uniform float pixHeight;
|
//uniform float pixHeight;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -22,10 +22,11 @@ int UNSET = -1;
|
|||||||
|
|
||||||
|
|
||||||
vec3 getColor(vec2 uvCoord) {
|
vec3 getColor(vec2 uvCoord) {
|
||||||
return texture(myTextureSampler, UV).rgb;
|
return texture(myTextureSampler, uvCoord).rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBackground(vec3 c) {
|
bool isBackground(vec3 c) {
|
||||||
|
// 49,206, 11
|
||||||
if (all( lessThanEqual(c, vec3(51.0f/255.0f, 208.0f/255.0f, 13.0f/255.0f))) &&
|
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)))
|
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(){
|
void main(){
|
||||||
|
float pixWidth = 0.001174f;
|
||||||
|
float pixHeight = 0.002083f;
|
||||||
int status = UNSET;
|
int status = UNSET;
|
||||||
float pw = pixWidth;
|
float pw = pixWidth;
|
||||||
float ph = pixHeight;
|
float ph = pixHeight;
|
||||||
|
|
||||||
// 49,206, 11
|
|
||||||
// Output color = color of the texture at the specified UV
|
// Output color = color of the texture at the specified UV
|
||||||
color = getColor(UV);
|
|
||||||
for(int w=-5;w<=5;w++){
|
for(int w=-5;w<=5;w++){
|
||||||
for(int h=-5;h<=5;h++){
|
for(int h=-5;h<=5;h++){
|
||||||
if (w+h==-10) { // first pixel
|
if (w+h==-10) { // first pixel
|
||||||
|
|||||||
Reference in New Issue
Block a user