ValveSoftware / steamvr_unity_plugin

SteamVR Unity Plugin - Documentation at: https://valvesoftware.github.io/steamvr_unity_plugin/
BSD 3-Clause "New" or "Revised" License
1.03k stars 256 forks source link

Multisample texture error when using Post Processing package in Unity 2020 #942

Open mukobi opened 3 years ago

mukobi commented 3 years ago

Steps to reproduce:

  1. Create a new Unity project with Unity 2020.3 (2020.3.2f1 used in my testing)
  2. Install the XR Plugin Management package (v4.0.1 verified), the Post Processing package (v3.1.0 verified), and the latest SteamVR Unity Plugin (v2.7.3 used in my testing)
  3. In a new scene (issue happens with a default scene with a static camera, but also reproducible with the tracked CameraRig prefab), enter play mode. Observe that the console is free of errors, and an image is visible in the HMD.
  4. Now add Post-process Layer component onto the camera game object (either the "Main Camera" object in a new scene or the "Camera" object in the SteamVR CameraRig prefab.
  5. Enter play mode again. Observe that the headset now displays a solid grey instead of the scene and the console is now spammed with the following error:

    A multisampled texture being bound to a non-multisampled sampler. Disabling in order to avoid undefined behavior. Please use Texture2DMS in the shader.

Expected behavior:

Note:

Tested with Unity 2020.3.2f1, SteamVR Unity Plugin v2.7.3 (sdk 1.14.15)

mukobi commented 3 years ago

Oh, and one other crucial detail: This only happens in the default (and most common) Single Pass Instanced stereo rendering mode. If you switch that setting in Project Settings->XR Plug-in Management->OpenVR->Stereo Rendering Mode to Multi Pass, then the Post-process layer works as expected without errors and the HMD shows a valid image. However, most users will need to use Single Pass Instanced rendering.