- Home /
Question by
elingranath01 · May 10, 2021 at 12:36 PM ·
textureimagescreentexturesscreenshot
Colors are wrong in in-game screenshot
I'm making an in-game camera, but the colors in the final image are way off compared to the screen which it should be capturing. I'm not sure what setting is wrong. For testing purposes all post-processing effects are turned off.
RenderTexture renderTex = cam.targetTexture;
Texture2D renderResult = new Texture2D(picSize, picSize, TextureFormat.ARGB32, true);
Rect rect = new Rect(0, 0, picSize, picSize);
renderResult.ReadPixels(rect, 0, 0);
renderResult.Apply();
screenshot1.png
(107.4 kB)
screenshot0.png
(72.0 kB)
Comment
Answer by khusainova · May 11, 2021 at 07:56 AM
@elingranath01 Your problem may be related with gamma/linear space. RenderResult is in gamma space, renderTex is possible in linear space. Try set linear space to RenderResult or do gamma correction after renderResult.ReadPixels()
Your answer
Follow this Question
Related Questions
Init a Texture from filename 1 Answer
Preview of screenshot in unity 2 Answers
CaptureScreenshot to Texture 1 Answer