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.
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.
