divider + 0.001)
{
float height = texdim0.x/30.0; // <---------- CHANGE ME TO CHANGE HOW BIG THE TRIXELS ARE
//float height = texdim0.x/(40.0+(divider*40.0));
float halfHeight = height*0.5;
float halfBase = height/sqrt(3.0);
float base = halfBase*2.0;
float screenX = inFragCoord.x;
float screenY = inFragCoord.y;
float upSlope = height/halfBase;
float downSlope = -height/halfBase;
float oddRow = mod(floor(screenY/height),2.0);
screenX -= halfBase*oddRow;
float oddCollumn = mod(floor(screenX/halfBase), 2.0);
float localX = mod(screenX, halfBase);
float localY = mod(screenY, height);
if(oddCollumn == 0.0 )
{
if(localY >= localX*upSlope)
{
screenX -= halfBase;
}
}
else
{
if(localY <= height+localX*downSlope)
{
screenX -= halfBase;
}
}
float startX = floor(screenX/halfBase)*halfBase;
float startY = floor(screenY/height)*height;
vec4 blend = vec4(0.0,0.0,0.0,0.0);
for(float x = 0.0; x < 3.0; x += 1.0)
{
for(float y = 0.0; y < 3.0; y += 1.0)
{
vec2 screenPos = vec2(startX+x*halfBase,startY+y*halfHeight);
vec2 uv = screenPos / texdim1.xy;
//uv.x -= 0.5;
//blend += vec4(uv,0.5+0.5*sin(time),1.0);
blend += texture2DRect(tex1, uv);
}
}
gl_FragColor = (blend / 9.0);
/*
float startX = floor(screenX/base)*base + halfBase;
float startY = floor(screenY/height)*height + halfHeight;
vec2 screenPos = vec2(startX,startY);
vec2 uv = screenPos / texdim1.xy;
uv.x -= 0.5;
//fragColor = vec4(uv,0.5+0.5*sin(time),1.0);
gl_FragColor = texture2DRect(tex1, uv);
*/
}
else if(inUV.x < divider)
{
//fragColor = vec4(inUV,0.5+0.5*sin(time),1.0);
gl_FragColor = texture2DRect(tex1, inUV);
}
}
]]>