프로그래밍/예전글

렌더텍스쳐 좌표계(Render Texture coordinates)

Cat체셔 2016. 6. 15. 16:30

참고 : http://docs.unity3d.com/Manual/SL-PlatformDifferences.html



문제

오늘 스크린샷 기능 만들다가 Unity RenderTexture의 이상한 점을 발견했습니다.


바로 그래픽스 sdk에 따라 Coordinate system이 다르다는 사실...

참고 URL을 가보시면 이런 글을 확인하실 수 있습니다.



해결방법


1
2
3
4
5
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGL2 ||
    SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLCore ||
    SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2 ||
    SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES3)
 
cs

위 조건일 때, y값을 반전시켜주시면 됩니다.