I made a script to take screenshot and display the image on GUI. But since my project has to use linear color space, when I use the screenshot image as Texture2D on GUI, the image become dark.
is there any solution for this problem?
// to capture screenshot//
Texture2D screenCap;
screenCap = new Texture2D(1024,1024, TextureFormat.RGB24, false);
screenCap.ReadPixels(new Rect(Screen.width /2 - 512, Screen.height /2 - 512 ,1024,1024), 0, 0);
screenCap.Apply();
// to see captured image void OnGUI//
GUI.DrawTexture(new Rect(100, 100, 300, 300), screenCap);