Search code examples
unity-game-engineunity3d-editor

Get rid of "Postprocessing package expects to be used fullscreen" warning (Mac, built-in pipeline)


I've added post-processing to my scene, and everything works fine. I'm using a single Camera. Whenever I click anywhere in the Scene view, I get the following warning in the console:

When used with builtin render pipeline, Postprocessing package expects to be used on a fullscreen Camera. Please note that using Camera viewport may result in visual artefacts or some things not working. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

The warning does not show when I go into Play mode. Only in the scene editor.

I am using the built-in rendering pipeline with Unity 2019.4.0f1 on a Mac. I've stepped into Unity post-processing code (their code, not mine) that generates the warning. I can see that the camera rect is retrieved and because X and Y values are greater than zero, the warning is logged. The Unity code in question is shown below:

{
  Rect r = m_Camera.rect;
  if(Mathf.Abs(r.x) > 1e-6f || Mathf.Abs(r.y) > 1e-6f || Mathf.Abs(1.0f - r.width) > 1e-6f || Mathf.Abs(1.0f - r.height) > 1e-6f)
  {
    Debug.LogWarning("When used with builtin render pipeline, Postprocessing package expects to be used on a fullscreen Camera.\nPlease note that using Camera viewport may result in visual artefacts or some things not working.", m_Camera);
  }
}

Again, the code above is Unity code, and I don't want to change it. The x and y values of r above are sometimes greater than 0 and other times not.

I've verified that camera viewport settings in the inspector are set to x:0,y:0,w:1,h:1. I've verified that there is just one camera in my scene.

There is a similar question and answer on SO. But the user is using the Universal Render Pipeline and the solution that worked for him doesn't seem to apply to me. I looked in project settings under graphics, and none of the options there seemed to correspond to a solution.


Solution

  • This only happens on macs and the only solution I found is to disable the usage of metal API in the editor scene view as seen here: enter image description here

    Here's an explanation for what's going on: when debugging the PostProcessingLayer code it looks like the m_Camera variable is not the camera object one, its the scene view one. I could not find a way to set the x or y properties on it. However, this still doesn't explain why this happens only on mac enter image description here It happens because for the metal API (an API to communicating with the GPU that's only available for mac) for some reason "SystemInfo.usesLoadStoreActions" is true on the metal API. The checkbox shown in the first image will disable the usage of metal API only in the editor view so real gameplay won't be affected