Standard Assets - Image Effects crashes after taking a screen shot

I’m using this piece of code to take screenshots of my game:

         Texture2D     image  = new Texture2D(Width,Height,TextureFormat.RGB24,false);
         RenderTexture rt     = new RenderTexture(Width,Height,24);
         cam.targetTexture    = rt;
         RenderTexture.active = rt;
         cam.Render();
         image.ReadPixels(new Rect(0,0,Width,Height),0,0);
         RenderTexture.active = null;
         cam.targetTexture    = null;

On 5.5 and previous, this routine doesn’t have any negative impact on the Image Effects attached to the camera, but on 5.6.03b executing these lines causes OnRenderImage to get a null value on the source render texture, which crashes any Image Effects attached to the camera. Once the Image Effects start to fail, if you disable them all, the image is rendered upside down.

Hi georgeq,
Could you please file a bug report for this issue and reply in this thread with the case #?

Case #869097

1 Like

Case #869097 they say they cannot reproduce the error, so I filed another bug report case #869516 and I received a confirmation they were able to reproduce the problem.