- Home /
Flip WebcamTexture vertically
I have a problem on my Surface Book. Unity always mirrors the WebcamTexture vertically but I need to mirror it back, so I can make (a lot of) calculations. Just setting the scale to -1 isn't a solution that is practical for me. Is there anyway to flip the texture not the image?
Answer by TheFloatingSheep · May 25, 2020 at 12:33 AM
I believe you can use WebCamTexture.GetPixels to feed the Texture2D.SetPixels method and then I think you could set the Texture2D
's WrapMode to TextureWrapMode.MirrorOnce, or you could make two loops, one for each axis, and flip or mirror the image however you want using Texture2D.GetPixel and Texture2D.SetPixel.
Alternatively, you can use:
renderer.material.SetTextureScale("_BaseMap", new Vector2(-1,1));
Your answer
Follow this Question
Related Questions
Projection mobile camera on a texture, at the same time using it as AR camera. Is it possible? 0 Answers
Cloud recognition in Vuforia 0 Answers
AR Foundation Image Tracking and Markers 0 Answers
How to fix webcamtexture "too zoomed in" issue on Android? 0 Answers
EasyAR 3.1.0 - webcam black screen after updating to Unity 2021.1.18f1 0 Answers