- Home /
Camera space conversions not always working with Pixel Perfect Camera
The Pixel Perfect camera's Upscale Render Texture setting messes up Camera space conversions (like ScreenToWorldPoint and ViewportToScreenPoint). With this setting enabled, the below code was used, with strange results. Some resolutions (such as 1920x1080 and 100x100) work fine, but others (1366x768 and 1000x1000) don't.
Vector2 topRight = Camera.main.ViewportToScreenPoint(new Vector3(1, 1, 0));
Debug.Log(topRight);
There doesn't appear to be any consistency, and the problem disappears when not using 'upscale render texture'. Could someone explain to me why this is happening and how to fix it?
Your answer
Follow this Question
Related Questions
How to keep the same position of the object instead of camera 0 Answers
How to retrive camera pixel data? 0 Answers
How do I use web camera values of certain pixels as input? 1 Answer
Pixel Perfect Camera not clearing screen that is cropped? 0 Answers
Camera.main.ScreenToWorldPoint return camera position 2 Answers