Tri-Map working now; output of every state in a different color

This commit is contained in:
Caesar2011
2016-09-05 22:21:12 +02:00
parent 2acbd0c10f
commit 2147b74e86
4 changed files with 9 additions and 7 deletions

View File

@@ -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