title: Editing a Cubemap Skybox from remote image
body: <p>I need to download an image from a server, then transform it in a Cubemap and finally put this CubeMap in my Skybox.</p>
  
  <p>I work with C#.</p>
  
  <p>I came up with this code :</p>
  
  <pre><code>public string url = "image/url.jpg";
  
  void Update() {
      // When trigger, we start the process
      if (Input.GetKeyDown("f")) {
  
          // start Coroutine to handle the WWW asynchronous process
          StartCoroutine("setImage");
      }
  }
  
  IEnumerator setImage () {
  
      Texture2D tex;
      tex = new Texture2D(2048, 2048, TextureFormat.RGBA32, false);
  
      WWW www = new WWW(url);
      //Texture myGUITexture = Resources.Load("23") as Texture;
  
      Debug.Log (www.bytesDownloaded);
      Debug.Log (www.progress);
      Debug.Log (www.texture);
  
      yield return www;
  
      // we put the downloaded image into the new texture
      www.LoadImageIntoTexture(tex);
  
      // new cubemap 
      Cubemap c = new Cubemap(2048, TextureFormat.RGBA32, false);
      Color[] CubeMapColors;
      CubeMapColors = tex.GetPixels();
      c.SetPixels(CubeMapColors, CubemapFace.PositiveX);
      // we set the cubemap from the texture pixel by pixel
      c.Apply();
  
      //NewTexture.isPowerOfTwo = true;
  
      //Debug.Log (RenderSettings.skybox.GetTexture ("_Tex"));
  
      // We change the Cubemap of the Skybox
      RenderSettings.skybox.SetTexture("_Tex", c);
  }
  </code></pre>
  
  <p>I commented all the code to explain what I think I am doing. </p>
  
  <p>I made this "trick" of creating the Cubemap pixel by pixel because the Editor way to do it (which is incredibly simple by the way) seems to be not possible from other people posts I could read.</p>
  
  <p>Eventually, the result was just a bunch of grey pixels.</p>
  
  <p>I don't really know what screw up so much in my process, the only "shadow" point I see is the TextureFormat.</p>
  
  <p>I chose RGBA32 because when I look at my Unity Editor, I see BC7 format, which is error logged as non possible for SetTexture and from the <a href="https://docs.unity3d.com/550/Documentation/ScriptReference/TextureFormat.BC7.html" rel="noreferrer">doc</a> they explain it may be decompressed in RGBA32.</p>
  
  <p>Of course there is no remaining error in the console.</p>
  
  <p>I am really surprised there is not a easy way to do it. I mean not necessarily taking from http an image and put it in skybox, but just change the texture of a skybox. Am I missing something ?</p>