varying vec3 coord;

const float step = 0.05;

const float first_step = 4.0;
const float last_step = 12.0;

const float color_bound_low = 0.45;
const float color_bound_high = 0.55;

const int iters = 4;

void main()
{
	vec3 origin = vec3(0.0, 0.0, 0.0);
	vec3 dir = normalize(coord - origin) * first_step;

	vec3 dirfuck[iters];

	for (int i=0; i<iters; i++)
	{
		dirfuck[i] = sin(dir);
		dir = dir + vec3(step);
	}

	float c;
	int fuck = 0;
	float fuckc;
	vec3 fuckfuck;

	vec3 m;
	float fuckx;
	float fucky;
	float fuckz;

/*	for (int i=0; i<iters; i++)
	{
		m = dirfuck[i];

		fuckx = m.x;
		fucky = m.y;
		fuckz = m.z;

		c = fuckx + fucky;

//		c = sin(m.x) + sin(m.y); //sin(m.x) + sin(m.y) + sin(m.z);

// + sin(dir.x + dir.y) + sin(dir.x + dir.z) + sin(dir.y + dir.z);

		if (fuck==0 && c > color_bound_low && c < color_bound_high)
		{
			fuck = 1;
			fuckfuck = dir;
			fuckc = c;
		}
	}*/

	vec3 shit = vec3(0.0, 0.0, 0.0);
	float grd = fuckc;

	gl_FragColor = vec4(grd, grd, grd, grd);
}
