5

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.

Erik Hermansen
  • 2,200
  • 3
  • 21
  • 41
  • Hmm, the -1 on the question without any feedback is pretty useless. My question was authored in good faith. If you want me to annoy you less in the future, you should say why you think the question has a problem. – Erik Hermansen Jun 12 '20 at 17:27

2 Answers2

3

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

Yftach
  • 712
  • 5
  • 15
1

Is your W or H on viewport something other than 1?

There was an update awhile back to display a warning if the viewport is something other than that: https://docs.unity3d.com/Packages/com.unity.postprocessing@2.1/changelog/CHANGELOG.html

The changelog says the warning is just for mobile but I can see it in my editor and my build is not set to mobile.

But anyway, setting viewport to 1 w and h and 0 for x and y solves the problem.

Mar
  • 115
  • 1
  • 3
  • 12
  • I ran the debugger inside of the Unity postprocessing code (not my code) that generates the warning. The code that shows the warning looks at the active camera rect. And in my debug session, that rect has W and H of 1, and X and Y > 0. The condition of X and Y being greater than 0 is what triggers the warning. But I am lost when you say set the viewport X and Y to 0. How would I do that? – Erik Hermansen Jun 13 '20 at 21:55
  • You can set the viewport x and y in Unity's editor under the Camera Component there is a "Viewport Rect" to 0 for both x and y. – Mar Jun 16 '20 at 13:19
  • Great suggestion and I think it could be helpful for some. But unfortunately, in my case, "x" and "y" are set to 0, "w" and "h" to 1, in the Camera component. I've updated my question to include these specific results. – Erik Hermansen Jun 17 '20 at 19:56