void OnEnable() { if (!haveBundlesBeenInited) { InitBundles(); } m_LogHistogram = new LogHistogram(); m_PropertySheetFactory = new PropertySheetFactory(); m_TargetPool = new TargetPool(); // Scriptable render pipeline handles their own command buffers if (RuntimeUtilities.scriptableRenderPipelineActive) { return; } m_LegacyCmdBuffer = new CommandBuffer { name = "Post-processing" }; m_LegacyCmdBufferOpaque = new CommandBuffer { name = "Opaque Only Post-processing" }; m_Camera = GetComponent <Camera>(); m_Camera.AddCommandBuffer(CameraEvent.BeforeImageEffectsOpaque, m_LegacyCmdBufferOpaque); m_Camera.AddCommandBuffer(CameraEvent.BeforeImageEffects, m_LegacyCmdBuffer); // Internal context used if no SRP is set m_CurrentContext = new PostProcessRenderContext(); }
void OnEnable() { m_Bundles = new Dictionary <Type, PostProcessBundle>(); m_SortedBundles = new Dictionary <PostProcessEvent, List <PostProcessBundle> >(new PostProcessEventComparer()) { { PostProcessEvent.BeforeTransparent, new List <PostProcessBundle>() }, { PostProcessEvent.BeforeStack, new List <PostProcessBundle>() }, { PostProcessEvent.AfterStack, new List <PostProcessBundle>() } }; foreach (var type in VolumeManager.instance.settingsTypes.Keys) { var settings = (PostProcessEffectSettings)ScriptableObject.CreateInstance(type); var bundle = new PostProcessBundle(settings); m_Bundles.Add(type, bundle); if (!bundle.attribute.builtinEffect) { m_SortedBundles[bundle.attribute.eventType].Add(bundle); } } m_PropertySheetFactory = new PropertySheetFactory(); m_BlueNoise = new BlueNoise(); // Scriptable render pipeline handles their own command buffers if (RuntimeUtilities.scriptableRenderPipelineActive) { return; } m_LegacyCmdBuffer = new CommandBuffer { name = "Post-processing" }; m_LegacyCmdBufferOpaque = new CommandBuffer { name = "Opaque Only Post-processing" }; m_Camera = GetComponent <Camera>(); m_Camera.AddCommandBuffer(CameraEvent.BeforeImageEffectsOpaque, m_LegacyCmdBufferOpaque); m_Camera.AddCommandBuffer(CameraEvent.BeforeImageEffects, m_LegacyCmdBuffer); // Internal context used if no SRP is set m_CurrentContext = new PostProcessRenderContext(); }
internal void BeginFrame(PostProcessRenderContext context) { m_Command = context.command; m_PropertySheets = context.propertySheets; m_Resources = context.resources; }