 const int STEPNUM = 32;
 
 uniform float eye_offset;
+uniform float edge_r;
 uniform float frame_scalex;
 uniform float frame_scaley;
 uniform float pixel_size_x;

			roll_base = -M_PI_DIV_4;
		}
		float roll_diff = roll - roll_base;
		float roll_gain = (M_PI - 4.0 * acos(1.0 / r)) / M_PI;
		roll = roll_diff * roll_gain + roll_base;
	}

	if (z == 1.0) {

	float pitch = acos(z);
	float roll = atan(y, x);
	float r = get_y(pitch, pitch_table, r_table);
	float edge_r_s = 1.0 - edge_r;
	float edge_r_e = sqrt(1.0*1.0 + edge_r*edge_r);
	if (r > edge_r_s) {
		float roll_base;
		if (material_index == 0.0) {
			roll_base = M_PI_DIV_4;
