Exemplo n.º 1
0
    public PerObjectBloomRenderer()
    {
        m_Blur = new CommandBufferBlur();

        m_BlurTemp1 = Shader.PropertyToID("_Temp1");
        m_BlurTemp2 = Shader.PropertyToID("_Temp2");

        m_MaskedBrightnessBlit = CoreUtils.CreateEngineMaterial(k_MaskedBightnessBlitShader);
        m_AdditiveBlit         = CoreUtils.CreateEngineMaterial(k_AdditiveBlitShader);
    }
        void InitializeDebug(Mesh debugProbeMesh, Shader debugProbeShader)
        {
            m_DebugMesh     = debugProbeMesh;
            m_DebugMaterial = CoreUtils.CreateEngineMaterial(debugProbeShader);
            m_DebugMaterial.enableInstancing = true;

            // Hard-coded colors for now.
            Debug.Assert(ProbeBrickIndex.kMaxSubdivisionLevels == 7); // Update list if this changes.
            subdivisionDebugColors[0] = new Color(1.0f, 0.0f, 0.0f);
            subdivisionDebugColors[1] = new Color(0.0f, 1.0f, 0.0f);
            subdivisionDebugColors[2] = new Color(0.0f, 0.0f, 1.0f);
            subdivisionDebugColors[3] = new Color(1.0f, 1.0f, 0.0f);
            subdivisionDebugColors[4] = new Color(1.0f, 0.0f, 1.0f);
            subdivisionDebugColors[5] = new Color(0.0f, 1.0f, 1.0f);
            subdivisionDebugColors[6] = new Color(0.5f, 0.5f, 0.5f);

            RegisterDebug();
        }
        void InitializeDebug(Mesh debugProbeMesh, Shader debugProbeShader)
        {
            m_DebugMesh     = debugProbeMesh;
            m_DebugMaterial = CoreUtils.CreateEngineMaterial(debugProbeShader);
            m_DebugMaterial.enableInstancing = true;

            // Hard-coded colors for now.
            Debug.Assert(ProbeBrickIndex.kMaxSubdivisionLevels == 7); // Update list if this changes.
            subdivisionDebugColors[0] = new Color(1.0f, 0.0f, 0.0f);
            subdivisionDebugColors[1] = new Color(0.0f, 1.0f, 0.0f);
            subdivisionDebugColors[2] = new Color(0.0f, 0.0f, 1.0f);
            subdivisionDebugColors[3] = new Color(1.0f, 1.0f, 0.0f);
            subdivisionDebugColors[4] = new Color(1.0f, 0.0f, 1.0f);
            subdivisionDebugColors[5] = new Color(0.0f, 1.0f, 1.0f);
            subdivisionDebugColors[6] = new Color(0.5f, 0.5f, 0.5f);

            RegisterDebug();

#if UNITY_EDITOR
            UnityEditor.Lightmapping.lightingDataCleared += OnClearLightingdata;
#endif
        }