- Home /
 
 
               Question by 
               dbchest · Aug 16, 2019 at 05:20 AM · 
                post processingscreenshotpost-processing  
              
 
              How to capture the screen with post-process applied?
I want to capture the screen with any active post-process applied, but none of the post-process are included in the texture. is anyone able to walk me through the code for generating a screen capture with post-process applied to it? currently, my code looks like this:
 /// <summary>
 /// Method for capturing the screen with post process applied
 /// </summary>
 private IEnumerator CaptureScreenshotWithPostProcess()
 {
 RenderTexture renderTexture = new RenderTexture(Screen.width, Screen.height, 32);
 Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
 Camera camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
 
 RenderTexture.active = renderTexture;
 camera.targetTexture = renderTexture;
 
 yield return new WaitForEndOfFrame();
 
 Rect rect = new Rect(0, 0, Screen.width, Screen.height);
 Vector2 pivot = new Vector2(Screen.width / 2, Screen.height / 2);
 texture.ReadPixels(rect, 0, 0, false);
 texture.Apply();
 
 m_MenuBackground = Sprite.Create(texture, rect, pivot, 180f);
 
 camera.targetTexture = null;
 RenderTexture.active = null;
 }
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Running an OnRenderImage effect before the post processing stack (v2) 1 Answer
RenderTexture captured from camera with post effects only shows the emission pass. 1 Answer
Post Process v2 Layer without effects causes weird blur (bad VR experience) 0 Answers
Post Processing stack - Volume effects have all the fields disabled. 1 Answer
Player falling down after post processing turned on. 1 Answer