#version 330 core
out vec4 FragColor;

in vec3 ourColor;
in vec2 TexCoord;

// texture samplers
uniform sampler2D texture1;
//uniform sampler2D texture2;
uniform int mix;

void main()
{
   vec4 colorSample;
	// linearly interpolate between both textures (80% container, 20% awesomeface)
	//colorSample = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2);
	colorSample = texture(texture1, TexCoord);
   //colorSample = vec4(ourColor, 1.0f);
    vec3 o = vec3(colorSample.r, colorSample.g, colorSample.b);
    if(mix==1) {
       o = (ourColor * o) * 1.99f;
    }
//for(float i,g,e,s;++i<18.;o.rgb+=hsv(.08,.75,s/5e3)){vec3 p=vec3((FC.xy*2.-r)/r.y*(4.+cos(t*.5)*3.),g+.5)*rotate3D(t*.5,vec3(t)+1.);s=1.;for(int i;i++<15;p=vec3(0,3,3)-abs(abs(p)*e-vec3(3,1.5,3)))s*=e=max(1.,9./dot(p,p));g+=mod(length(p.yy),p.y)/s*.6;}

   //FragColor = colorSample);
   FragColor = vec4(o, 1.0f);
};

