public void Reset()
 {
     m_Camera           = null;
     width              = 0;
     height             = 0;
     m_sourceDescriptor = new RenderTextureDescriptor(0, 0);
     stereoActive       = false;
     xrActiveEye        = 0;
     screenWidth        = 0;
     screenHeight       = 0;
     command            = null;
     source             = 0;
     destination        = 0;
     sourceFormat       = RenderTextureFormat.ARGB32;
     flip                 = false;
     resources            = null;
     propertySheets       = null;
     debugLayer           = null;
     isSceneView          = false;
     antialiasing         = PostProcessLayer.Antialiasing.None;
     temporalAntialiasing = null;
     uberSheet            = null;
     autoExposureTexture  = null;
     logLut               = null;
     autoExposure         = null;
     bloomBufferNameID    = -1;
     if (userData == null)
     {
         userData = new Dictionary <string, object>();
     }
     userData.Clear();
 }
        public void Reset()
        {
            m_Camera = null;
            width    = 0;
            height   = 0;

#if UNITY_2017_2_OR_NEWER
            m_sourceDescriptor = new RenderTextureDescriptor(0, 0);
#endif
#if UNITY_2018_2_OR_NEWER
            physicalCamera = false;
#endif
            stereoActive = false;
            xrActiveEye  = (int)Camera.StereoscopicEye.Left;
            screenWidth  = 0;
            screenHeight = 0;

            command      = null;
            source       = 0;
            destination  = 0;
            sourceFormat = RenderTextureFormat.ARGB32;
            flip         = false;

            resources      = null;
            propertySheets = null;
            debugLayer     = null;
            isSceneView    = false;

            uberSheet           = default;
            autoExposureTexture = null;
            logLut            = null;
            autoExposure      = null;
            bloomBufferNameID = -1;
        }
Exemplo n.º 3
0
        public void Reset()
        {
            m_Camera = null;
            width    = 0;
            height   = 0;

#if UNITY_2017_2_OR_NEWER
            m_sourceDescriptor = new RenderTextureDescriptor(0, 0);
#endif

            stereoActive = false;
            xrActiveEye  = (int)Camera.StereoscopicEye.Left;
            screenWidth  = 0;
            screenHeight = 0;

            command      = null;
            source       = 0;
            destination  = 0;
            sourceFormat = RenderTextureFormat.ARGB32;
            flip         = false;

            resources            = null;
            propertySheets       = null;
            debugLayer           = null;
            isSceneView          = false;
            antialiasing         = PostProcessLayer.Antialiasing.None;
            temporalAntialiasing = null;

//custom-begin: autofocus
            depthOfFieldAutoFocus = null;
//custom-end

            uberSheet           = null;
            autoExposureTexture = null;
            logLut            = null;
            autoExposure      = null;
            bloomBufferNameID = -1;

            if (userData == null)
            {
                userData = new Dictionary <string, object>();
            }

            userData.Clear();
        }
Exemplo n.º 4
0
        internal override void Render(PostProcessRenderContext context)
        {
            CheckOutput(width, height);
            LogHistogram  logHistogram  = context.logHistogram;
            PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.lightMeter);

            propertySheet.ClearKeywords();
            propertySheet.properties.SetBuffer(ShaderIDs.HistogramBuffer, logHistogram.data);
            Vector4 histogramScaleOffsetRes = logHistogram.GetHistogramScaleOffsetRes(context);

            histogramScaleOffsetRes.z = 1f / (float)width;
            histogramScaleOffsetRes.w = 1f / (float)height;
            propertySheet.properties.SetVector(ShaderIDs.ScaleOffsetRes, histogramScaleOffsetRes);
            if (context.logLut != null && showCurves)
            {
                propertySheet.EnableKeyword("COLOR_GRADING_HDR");
                propertySheet.properties.SetTexture(ShaderIDs.Lut3D, context.logLut);
            }
            AutoExposure autoExposure = context.autoExposure;

            if (autoExposure != null)
            {
                float x = autoExposure.filtering.value.x;
                float y = autoExposure.filtering.value.y;
                y = Mathf.Clamp(y, 1.01f, 99f);
                x = Mathf.Clamp(x, 1f, y - 0.01f);
                Vector4 value = new Vector4(x * 0.01f, y * 0.01f, RuntimeUtilities.Exp2(autoExposure.minLuminance.value), RuntimeUtilities.Exp2(autoExposure.maxLuminance.value));
                propertySheet.EnableKeyword("AUTO_EXPOSURE");
                propertySheet.properties.SetVector(ShaderIDs.Params, value);
            }
            CommandBuffer command = context.command;

            command.BeginSample("LightMeter");
            command.BlitFullscreenTriangle(BuiltinRenderTextureType.None, base.output, propertySheet, 0);
            command.EndSample("LightMeter");
        }