 		
 		public function setContentFromATF(atf : ByteArray) : void
 		{
-			throw new Error('Not yet implemented');
+			_atf			= atf;
+			_bitmapDatas    = null;
+
+			var oldSize 	: uint = _size;
+			var oldFormat	: String = _format;
+
+			atf.position 	= 6;
+
+			var formatByte 	: uint  = atf.readUnsignedByte();
+			var atfFormat   : uint	= formatByte & 7;
+			_size 			        = 1 << atf.readUnsignedByte();
+
+			atf.position 	= 0;
+
+			switch (atfFormat) {
+				case 0: case 1: _format = FORMAT_BGRA; break;
+				case 2: case 3: _format = FORMAT_COMPRESSED; break;
+				case 4: case 5: _format = FORMAT_COMPRESSED_ALPHA; break
+				default: throw new Error("Invalid ATF format");
+			}
+
+			if (_resource
+					&& (oldFormat != _format
+					|| oldSize != _size
+					))
+			{
+				_resource.dispose();
+				_resource = null;
+			}
 		}
 		
 		public function getTexture(context : Context3DResource) : TextureBase
 		{
 			if (!_resource)
-				_resource = context.createCubeTexture(_size, Context3DTextureFormat.BGRA, true);
-			
+				_resource = context.createCubeTexture(_size, _format, _bitmapDatas != null && _atf == null);
+			else
+				return _resource;
+
 			if (_bitmapDatas != null)
 			{
 				for (var side : uint = 0; side < 6; ++side)

{
	import aerys.minko.render.resource.Context3DResource;
	import aerys.minko.type.enum.SamplerFormat;
	
	import flash.display.BitmapData;
	import flash.display3D.Context3DTextureFormat;
	import flash.display3D.textures.CubeTexture;

		{
			_bitmapDatas = new <BitmapData>[];
            _mipMapping = mipmap;
			_format = FORMAT_BGRA;

			var width	: Number = bitmapData.width / 4;
			var height	: Number = bitmapData.height / 3;
			
