I cannot seem to create the entire Post Process Stack via coding. I get lots of errors. I have followed the sporadic Answers online for modifiying the PPS via code but this doesnt really tell me much about how it works and the Unity documentation is awful for people who program software, as it relys heavily upon drag and drop development, so no luck there! sigh
I use no prefabs so answers such like “just drag it via the inspector” wont help as this is not useful for me as I do not use any prefabs whatsoever.
So far I have added a Layer to the camera and have an object with the Volume in it.
I am setting up everything correctly but…
My main issue seems to be I am unable to load a PP Profile into the Volume via code wether Resources.Load() is in Awake or Start()…It simply doesnt appear!
I had this issue months ago and gave up. Im sure my Resources Load path is correct!
Is there any reason why I shouldnt be able to Load the PPP via code?
This is my Error which is massivley unhelpful but as I mentioned my profile seems to be unable to be set at runtime so I assume this is the error.
I tried this a few months back and had the exact same issue!
Would be really helpful if somone else has tried to set this all up via code
NullReferenceException: Object reference not set to an instance of an object UnityEngine.Rendering.PostProcessing.AmbientOcclusion.IsEnabledAndSupported (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCacheemail@example.com/PostProcessing/Runtime/Effects/AmbientOcclusion.cs:182) UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetLegacyCameraFlags (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCachefirstname.lastname@example.org/PostProcessing/Runtime/PostProcessLayer.cs:771) UnityEngine.Rendering.PostProcessing.PostProcessLayer.SetupContext (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCacheemail@example.com/PostProcessing/Runtime/PostProcessLayer.cs:863) UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Library/PackageCachefirstname.lastname@example.org/PostProcessing/Runtime/PostProcessLayer.cs:533) UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Library/PackageCacheemail@example.com/PostProcessing/Runtime/PostProcessLayer.cs:462) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)