#version 330 core

// Interpolated values from the vertex shaders
in vec2 UV;
uniform sampler2D inputtex;
uniform sampler2D posbuf;
uniform float modulos;

// output
layout(location = 0) out vec4 color;


void main() {
  
  // Procedural approach
  vec3 origpos = texture(posbuf, UV).xyz;
  vec4 origcolor = texture(inputtex, UV);
  color = origcolor;

/*
  float possum = dot(origpos, vec3(1.0));
  color = vec4(vec3(mod(possum, modulos) > modulos / 2.0), 1.0) * origcolor;
  if (mod(possum, modulos) <= modulos / 2.0) {
    color = origcolor;
  }
  */
}
