I have a screenshot system in place that will use a camera to generate a render texture which converts to a PNG, and I’m getting a strange reflection issue in some of my shots.
Here’s a quick screenshot I grabbed with the snipping tool of my Game View
Here’s a screenshot I got using the Screenshot system
I’ve used this screenshot system to take screenshots in multiple projects and this is the only time it’s come up. Its also only shows the weird reflections when taking screenshots inside the building. If I take exterior shots, there’s no reflections.
And here’s the code for my screenshot system:
public void Save(RenderTexture rt)
{
Texture2D tex = new Texture2D(rt.width, rt.height);
RenderTexture.active = rt;
tex.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
RenderTexture.active = null;
byte[] bytes = tex.EncodeToPNG();
string path = Application.dataPath + "/360ImageCapture/Pictures/" + photoName;
if (File.Exists(path + fileType))
{
duplicateNumber += 1;
path = path + duplicateNumber + fileType;
}
else
{
duplicateNumber = 0;
path = path + fileType;
}
File.WriteAllBytes(path, bytes);
Debug.Log("Saved Image to " + path);
}