I am using a webcam to create a texture. On the editor in pc the image is right orientation, the camera preview on the plane is everything. So i use this code to save out the png:
Texture2D TakeSnapShot()
{
Texture2D snap = new Texture2D(webCamTex.width, webCamTex.height);
snap.SetPixels (webCamTex.GetPixels());
snap.Apply();
#if UNITY_EDITOR
System.IO.File.WriteAllBytes(_SavePathPC, snap.EncodeToPNG());
#endif
#if UNITY_ANDROID
_SavePathAndroid = Application.persistentDataPath + "/image.png";
System.IO.File.WriteAllBytes(_SavePathAndroid, snap.EncodeToPNG());
#endif
return snap;
}
This worked great until I did this on a mobile device. I instantly found out I had to use this code here:
To orientate the camera display preview on the plane right. Fine and dandy, but my above code that writes out he data now writes it out as if I never set that rotation angle for the plane, so its all jacked up and rotated wrong.
Was curious if there was a quick way to rotate the snap texture above based on the rotation of that videoRotationAngle (without using a shader) or using a shader, I just would need a ton of hand holding on how to do shaders…