// xs_begin
// author : 'ephtracy'
// xs_end

//===== user args =====
// uniform float	i_args[8];

//===== built-in args =====
// uniform vec3		i_volume_size;	// volume size [1-256]
// uniform float	i_color_index;	// color index [0-255]
// uniform vec3		i_mirror;		// mirror mode [0,1]
// uniform vec3		i_axis;			// axis mode [0,1]
// uniform float	i_iter;			// iteration index

//===== built-in functions ===== 
// float voxel( vec3 v );			// get voxel color index at position v

float map( vec3 v ) {				// generate a new voxel color index at position v ( v is at the center of voxel, such as vec3( 1.5, 2.5, 4.5 ) )
	const float PI = 3.1415926;
	v = ( v - i_volume_size * 0.5 ) / ( i_volume_size * 0.5 );
	return i_color_index * step( length( v ), 1.0 );
}
