コード例 #1
0
 // Token: 0x060075B6 RID: 30134 RVA: 0x0023F931 File Offset: 0x0023DB31
 public Material LNLKMDPHDCC()
 {
     if (this.m_Material == null)
     {
         this.m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(this.FMOMOEOJFKH());
     }
     return(this.m_Material);
 }
コード例 #2
0
 // Token: 0x060075C8 RID: 30152 RVA: 0x0023FCAA File Offset: 0x0023DEAA
 public Material KAFBNOBOIAJ()
 {
     if (this.m_Material == null)
     {
         this.m_Material = ImageEffectHelper.CheckShaderAndCreateMaterial(this.BNHIJFAKEIM());
     }
     return(this.m_Material);
 }
コード例 #3
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, false, false, this))
            {
                enabled = false;
            }

            m_RTU = new RenderTextureUtility();
        }
コード例 #4
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, false, true, this))
            {
                enabled = false;
                return;
            }

            GetComponent <Camera>().depthTextureMode |= DepthTextureMode.Depth;
        }
コード例 #5
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, false, true, this))
            {
                enabled = false;
                return;
            }

            SetDirty();
            SetTonemapperDirty();
        }
コード例 #6
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, true, false, this))
            {
                enabled = false;
            }

            camera_.depthTextureMode |= DepthTextureMode.Depth;
            m_DistanceColorSource.m_GradientDirty = true;
            m_HeightColorSource.m_GradientDirty   = true;
        }
コード例 #7
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, true, false, this))
            {
                enabled = false;
            }

            camera_.depthTextureMode |= DepthTextureMode.Depth;

            UpdateProperties();
        }
コード例 #8
0
        protected void OnEnable()
        {
            if (tonemapShader == null)
            {
                tonemapShader = Shader.Find("Hidden/TonemappingColorGrading");
            }

            if (ImageEffectHelper.IsSupported(tonemapShader, false, true, this))
            {
                return;
            }

            enabled = false;
            Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
        }
コード例 #9
0
        protected void OnEnable()
        {
            if (ssrShader == null)
            {
                ssrShader = Shader.Find("Hidden/ScreenSpaceReflection");
            }

            if (!ImageEffectHelper.IsSupported(ssrShader, true, true, this))
            {
                enabled = false;
                Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
                return;
            }

            GetComponent <Camera>().depthTextureMode |= DepthTextureMode.Depth;
        }
コード例 #10
0
        protected void OnEnable()
        {
            if (smaaShader == null)
            {
                smaaShader = Shader.Find("Hidden/SMAA");
            }

            if (!ImageEffectHelper.IsSupported(smaaShader, true, true, this))
            {
                enabled = false;
                Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
                return;
            }

            aaCamera.depthTextureMode |= DepthTextureMode.Depth;
        }
コード例 #11
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(filmicDepthOfFieldShader, true, true, this) || !ImageEffectHelper.IsSupported(medianFilterShader, true, true, this))
            {
                enabled = false;
                return;
            }

            if (ImageEffectHelper.supportsDX11 && !ImageEffectHelper.IsSupported(textureBokehShader, true, true, this))
            {
                enabled = false;
                return;
            }

            ComputeBlurDirections(true);
            GetComponent <Camera>().depthTextureMode |= DepthTextureMode.Depth;
        }
コード例 #12
0
        void UpdateHistogram(RenderTexture source, Rect rect, HistogramMode mode)
        {
            if (m_HistogramMaterial == null)
            {
                m_HistogramMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(concreteTarget.histogramShader);
            }

            if (m_HistogramBuffer == null)
            {
                m_HistogramBuffer = new ComputeBuffer(256, sizeof(uint) << 2);
            }

            m_HistogramBuffer.SetData(k_EmptyBuffer);

            ComputeShader cs = concreteTarget.histogramComputeShader;

            int kernel = cs.FindKernel("KHistogramGather");

            cs.SetBuffer(kernel, "_Histogram", m_HistogramBuffer);
            cs.SetTexture(kernel, "_Source", source);
            cs.SetVector("_SourceSize", new Vector2(source.width, source.height));
            cs.SetInt("_IsLinear", concreteTarget.isGammaColorSpace ? 0 : 1);
            cs.Dispatch(kernel, Mathf.CeilToInt(source.width / 32f), Mathf.CeilToInt(source.height / 32f), 1);

            kernel = cs.FindKernel("KHistogramScale");
            cs.SetBuffer(kernel, "_Histogram", m_HistogramBuffer);
            cs.SetFloat("_Height", rect.height);
            cs.Dispatch(kernel, 1, 1, 1);

            if (m_HistogramTexture == null || m_HistogramTexture.height != rect.height || m_HistogramTexture.width != rect.width)
            {
                DestroyImmediate(m_HistogramTexture);
                m_HistogramTexture           = new RenderTexture((int)rect.width, (int)rect.height, 0, RenderTextureFormat.ARGB32);
                m_HistogramTexture.hideFlags = HideFlags.HideAndDontSave;
            }

            m_HistogramMaterial.SetBuffer("_Histogram", m_HistogramBuffer);
            m_HistogramMaterial.SetVector("_Size", new Vector2(m_HistogramTexture.width, m_HistogramTexture.height));
            m_HistogramMaterial.SetColor("_ColorR", redCurveColor);
            m_HistogramMaterial.SetColor("_ColorG", greenCurveColor);
            m_HistogramMaterial.SetColor("_ColorB", blueCurveColor);
            m_HistogramMaterial.SetColor("_ColorL", masterCurveColor);
            m_HistogramMaterial.SetInt("_Channel", (int)mode);
            Graphics.Blit(m_HistogramTexture, m_HistogramTexture, m_HistogramMaterial, (mode == HistogramMode.RGB) ? 1 : 0);
        }
コード例 #13
0
ファイル: Bloom.cs プロジェクト: xxyzfd/AnotherThread
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, true, false, this))
            {
                enabled = false;
            }

            const int RT_NUM = 32;

            if (pool_rt1_ == null)
            {
                pool_rt1_ = new RenderTexture[RT_NUM];
            }
            if (pool_rt2_ == null)
            {
                pool_rt2_ = new RenderTexture[RT_NUM];
            }
        }
コード例 #14
0
        void OnEnable()
        {
            // Check if the shader is supported in the current platform.
            if (!ImageEffectHelper.IsSupported(aoShader, true, false, this))
            {
                enabled = false;
                return;
            }

            // Register the command buffer if in the ambient-only mode.
            if (ambientOnly)
            {
                targetCamera.AddCommandBuffer(CameraEvent.BeforeReflections, aoCommands);
            }

            // Requires DepthNormals when G-buffer is not available.
            if (!isGBufferAvailable)
            {
                targetCamera.depthTextureMode |= DepthTextureMode.DepthNormals;
            }
        }
コード例 #15
0
        protected void OnEnable()
        {
            if (filmicDepthOfFieldShader == null)
            {
                filmicDepthOfFieldShader = Shader.Find("Hidden/DepthOfField/DepthOfField");
            }

            if (medianFilterShader == null)
            {
                medianFilterShader = Shader.Find("Hidden/DepthOfField/MedianFilter");
            }

            if (textureBokehShader == null)
            {
                textureBokehShader = Shader.Find("Hidden/DepthOfField/BokehSplatting");
            }

            if (!ImageEffectHelper.IsSupported(filmicDepthOfFieldShader, true, true, this) ||
                !ImageEffectHelper.IsSupported(medianFilterShader, true, true, this)
                )
            {
                enabled = false;
                Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
                return;
            }

            if (ImageEffectHelper.supportsDX11)
            {
                if (!ImageEffectHelper.IsSupported(textureBokehShader, true, true, this))
                {
                    enabled = false;
                    Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
                    return;
                }
            }

            ComputeBlurDirections(true);
            GetComponent <Camera>().depthTextureMode |= DepthTextureMode.Depth;
        }
コード例 #16
0
        private void OnEnable()
        {
            if (!ImageEffectHelper.IsSupported(shader, false, true, this))
            {
                enabled = false;
                return;
            }

            camera_.depthTextureMode |= DepthTextureMode.Depth;

            kReflectionTextures = new int[5];

            kNormalAndRoughnessTexture = Shader.PropertyToID("_NormalAndRoughnessTexture");
            kHitPointTexture           = Shader.PropertyToID("_HitPointTexture");
            kReflectionTextures[0]     = Shader.PropertyToID("_ReflectionTexture0");
            kReflectionTextures[1]     = Shader.PropertyToID("_ReflectionTexture1");
            kReflectionTextures[2]     = Shader.PropertyToID("_ReflectionTexture2");
            kReflectionTextures[3]     = Shader.PropertyToID("_ReflectionTexture3");
            kReflectionTextures[4]     = Shader.PropertyToID("_ReflectionTexture4");
            kBlurTexture            = Shader.PropertyToID("_BlurTexture");
            kFilteredReflections    = Shader.PropertyToID("_FilteredReflections");
            kFinalReflectionTexture = Shader.PropertyToID("_FinalReflectionTexture");
            kTempTexture            = Shader.PropertyToID("_TempTexture");
        }