
float4 main(float4 position : POSITION,
            float3 texcoord : TEXCOORD0,
            float dist : TEXCOORD1,
            float invdist : TEXCOORD2,
            uniform sampler3D texture,
            uniform float time,
            uniform float power,
            uniform float3 incolor,
            uniform float usedist,
            uniform float tx,
            uniform float ty,
            uniform float tz) : COLOR0
{
	float3 tex = texcoord;

/*	float realdist = dist*2.0;
	if (realdist < 0.5) {
/*		float invdist = 1.0-dist*2.0;
		tex.x += tx;
		tex.y += ty;
		tex.z += tz;
		tex *= invdist;/
		tex.xyz = 0;
	}*/

	float4 color = tex3D(texture, tex);

	color.rgb *= incolor;

//	color.rgb = dist;
	return color*power;

//	return color*power*(dist*0.15);
}
