I am trying to get photos through instagram Api, process as I need and display them in the form of a slideshow.

Log in, get json data, get links to photos from there, pin photos, description, number of likes, etc., then I need to substitute them into a special prefab (on stage) that the RenderTexture camera created for this is looking for, save the rendered camera in the sprite and already use this sprite in the slide show. This is done for the purpose that not only the picture but also the text data is also jammed into the sprite to animate it with such effects as I need as a whole picture.

The problems started at the testing stage on different devices, on the Nexus5 everything works fine, on (for example) Acer Icona Tab a bunch of glitches and nothing adequate. An example of how it looks on a device where problems arise.

enter image description here

If at the same time I expose Edit - Graphics Emulation - OpenGL ES 2.0 in Unity, then Nexus5 does the same thing, attempts to expose the mipmap generation values ​​in False when baking the texture at runtime in Texture2D did not help. The baking code is as follows.

 private IEnumerator BakeData(RenderTexture rt, Action<List<Sprite>> callback) { for (int i = 0; i < _fs.Photos.Count; i++) { _fs.Photos[i].SetPhotoData(page, FeedViewConfig.Instance._modeEnum); yield return new WaitForEndOfFrame(); var txt2d = new Texture2D(rt.width, rt.height, TextureFormat.ARGB32, false,false); BakeCamera.targetTexture = rt; BakeCamera.Render(); RenderTexture.active = rt; txt2d.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0, true); txt2d.Apply(); var photoWidth = backCanvas.GetComponent<RectTransform>().rect.width; var photoHeight = photoWidth * 1.25f; var sprite = Sprite.Create(txt2d, new Rect(0, (txt2d.height - photoHeight) / 2, txt2d.width, photoHeight), Vector2.zero); yield return sprite; _pageSprites.Add(sprite); } BakeCamera.gameObject.SetActive(false); callback(_pageSprites); } 

where rt is RenderTexture In general, I will listen to any options and try them. Already broke his head.

  • And the display of 'naked' photos without surplus is normally drawn on the Icona Tab? - Shakra
  • To be honest, I don’t know, because of the inability to do it now. I suspect that in this case everything will be fine, because in the case of a “naked” photo, we simply save the photo by reference without RenderTexture. I can set the Open Gl Es2.0 emulation mode and try to save the bare photos on nexus5 - justyx
  • If it's not a photo, then you can try to create an animation by composing GUI elements so as not to get in touch with RenderTexture. - Shakra
  • @Shakra there are various animations, for example, book paging of photos, different variations of manifestation with fade, etc. and so on. Under each effect to make an animation, well, to put it mildly, not the most successful idea. I would like to find out where the legs grow all the same)) - justyx
  • I can only advise you to play with the settings of the secondary camera and see how the application behaves on the buggy phone. As a second option, try, for the test, discard the secondary chamber and use the primary chamber for baking. - Shakra

0