Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

RenderTexture.active not working on iOS

$
0
0
Hey Guys, I am trying to take a screenshot using a render texture. My code works fine in the editor and on Android too, but on iOS, I get a white texture. I am surprise because, when a texture is empty, I though that it was all black, so it seems like it captures something, but it is all white. Here is my code : public IEnumerator TakeScreenShot() { yield return new WaitForEndOfFrame(); mTex = new RenderTexture(Screen.width, Screen.height, 0); RenderTexture tempTexture = RenderTexture.active; RenderTexture.active = mTex; Camera.allCameras [0].targetTexture = mTex; RenderTexture.active = tempTexture; Camera.allCameras [0].targetTexture = null; gameObject.GetComponent ().materials [0].SetTexture (0, mTex); gameObject.GetComponent ().materials [1].SetTexture (0, mTex); StartAnimation (); } Does anybody have an idea ? Thanks a lot for your time ! Claude

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>