Beispiel #1
0
        static public void Setup(_2DRendererData rendererData)
        {
            s_RendererData    = rendererData;
            s_LightOperations = rendererData.lightOperations;

            if (s_RenderTargets == null)
            {
                s_RenderTargets = new RenderTargetHandle[s_LightOperations.Length];
                s_RenderTargets[0].Init("_ShapeLightTexture0");
                s_RenderTargets[1].Init("_ShapeLightTexture1");
                s_RenderTargets[2].Init("_ShapeLightTexture2");
                s_RenderTargets[3].Init("_ShapeLightTexture3");

                s_RenderTargetsDirty = new bool[s_LightOperations.Length];
            }

            if (s_NormalsTarget.id == 0)
            {
                s_NormalsTarget.Init("_NormalMap");
            }

            // The array size should be determined by the number of 'feature bit' the material index has. See GetLightMaterialIndex().
            // Not all slots must be filled because certain combinations of the feature bits don't make sense (e.g. sprite bit on + shape bit off).
            if (s_LightMaterials == null)
            {
                s_LightMaterials = new Material[k_NumberOfLightMaterials];
            }
        }
        public Render2DLightingPass(_2DRendererData rendererData)
        {
            if (s_SortingLayers == null)
            {
                s_SortingLayers = SortingLayer.layers;
            }

            m_RendererData = rendererData;
        }
 public _2DRenderer(_2DRendererData data) : base(data)
 {
     m_Render2DLightingPass = new Render2DLightingPass(data);
     m_PostProcessPass      = new PostProcessPass(RenderPassEvent.BeforeRenderingPostProcessing);
     m_FinalBlitPass        = new FinalBlitPass(RenderPassEvent.AfterRendering, CoreUtils.CreateEngineMaterial(data.blitShader));
 }
Beispiel #4
0
 public _2DRenderer(_2DRendererData data) : base(data)
 {
     m_Render2DLightingPass = new Render2DLightingPass(data);
 }