uniform samplerCube 	skyTex;
varying vec2			VPOS;

uniform mat4		cameraTM;

////////////////////////////
vec4 RGBMDecode( vec4 rgbm ) {
  return vec4(8.0 * rgbm.rgb * rgbm.a,1.0);
}

void main()
{
	// compute cur view pos
	vec4 wpos=cameraTM*vec4(-VPOS,1.0,0.0);
		
	// fetch into skycube tex
	gl_FragColor=RGBMDecode(textureCube(skyTex,normalize(wpos.xyz)));
}
