Reflection in Render Texture that doesn't exist in the Camera getting the Render Texture

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);
    }

Idk but it looks like Screen Space Ambient Occlusion texture has been scaled up and doesnt line up with the base image

you can notice shadows in the first image at the corners of the walls and that TV unit doesnt exists in the second image, i mean it exist but scaled up and doesnt line up

idk why would that happen or how, im just saying that it just looks like that
where do you get the RenderTexture from?

1 Like

This was it! Thanks for pointing it out. Still not sure why it’s misaligned the way it is, but it’s good to know the source of the problem.

The RenderTexture is one I made in the Asset Folder and assign to the system in the Inspector.

This is a long shot, but I’ve seen the postprocessing package apply changes one frame late. Maybe it works if you assign the render texture, wait for the next frame in a coroutine and then save out the texture.