using 2019 LTS and 2021.1.19 in URP mode
Greetings, I’m currently using a beta headmount display (tilt5) devkit that does not instantiate it’s left/right eye cameras until runtime.
If i set up a PostProcessing Volume, and then enter play mode, select the newly instantiated Left and Right Eye Cameras, and check the post processing checkbox, it works… but no good for builds…
I scripted 3 methods of hacking this post processing flag on:
1 modify the script listed in the makers docs to add…
UnityEngine.Rendering.Universal.UniversalAdditionalCameraData uac = eyeCamera.GetComponent<UnityEngine.Rendering.Universal.UniversalAdditionalCameraData>();
uac.renderPostProcessing = true;
…to each eye camera after instantiation
2 make a new script to find camera game objects by name, find camera component, and
UnityEngine.Rendering.Universal.UniversalAdditionalCameraData inside that and uac.renderPostProcessing = true;
3 alter the script attached to URP cameras [project folder]\Library\PackageCache\com.unity.render-pipelines.universal@7.3.1\Runtime\UniversalAdditionalCameraData.cs to force post processing variable to true…
[SerializeField] bool m_RenderPostProcessing = true;
all of these methods work in play mode IF and ONLY IF I click on the left and right eye cameras in the hierarchy prior to execution of the scripts in methods 1 and 2, and for method 3 as soon as the left and right cameras are clicked post processing is checked and it works… not before
So again, I can’t use these for a build, because instantiated cameras have this Schrodinger’s Cat like behavior, where they need to be highlighted in the hierarchy in play mode before the content of UniversalAdditionalCameraData.cs is active for the GameObject.
PostProcessing is only enabled by default when i look at the check box and the scripted variable to enable uac.renderPostProcessing on the cameras is null reference until i open the cameras on the hierarchy