Exemple #1
0
 public PostProcessingContext Reset()
 {
     profile              = null;
     camera               = null;
     materialFactory      = null;
     renderTextureFactory = null;
     interrupted          = false;
     return(this);
 }
        void OnEnable()
        {
            m_CommandBuffers       = new Dictionary <Type, KeyValuePair <CameraEvent, CommandBuffer> >();
            m_MaterialFactory      = new MaterialFactory();
            m_RenderTextureFactory = new RenderTextureFactory();
            m_Context = new PostProcessingContext();

            // Keep a list of all post-fx for automation purposes
            m_Components = new List <PostProcessingComponentBase>();

            // Component list
            m_DebugViews            = AddComponent(new BuiltinDebugViewsComponent());
            m_AmbientOcclusion      = AddComponent(new AmbientOcclusionComponent());
            m_ScreenSpaceReflection = AddComponent(new ScreenSpaceReflectionComponent());
            m_FogComponent          = AddComponent(new FogComponent());
            m_MotionBlur            = AddComponent(new MotionBlurComponent());
            m_Taa                 = AddComponent(new TaaComponent());
            m_EyeAdaptation       = AddComponent(new EyeAdaptationComponent());
            m_DepthOfField        = AddComponent(new DepthOfFieldComponent());
            m_Bloom               = AddComponent(new BloomComponent());
            m_ChromaticAberration = AddComponent(new ChromaticAberrationComponent());
            m_ColorGrading        = AddComponent(new ColorGradingComponent());
            m_UserLut             = AddComponent(new UserLutComponent());
            m_Grain               = AddComponent(new GrainComponent());
            m_Vignette            = AddComponent(new VignetteComponent());
            m_Dithering           = AddComponent(new DitheringComponent());
            m_Fxaa                = AddComponent(new FxaaComponent());

            // Prepare state observers
            m_ComponentStates = new Dictionary <PostProcessingComponentBase, bool>();

            foreach (var component in m_Components)
            {
                m_ComponentStates.Add(component, false);
            }

            useGUILayout = false;
        }