public RenderObjectsPass(string profilerTag, RenderPassEvent renderPassEvent, string[] shaderTags, RenderQueueType renderQueueType, int layerMask, RenderObjects.CustomCameraSettings cameraSettings)
        {
            m_ProfilerTag                  = profilerTag;
            m_ProfilingSampler             = new ProfilingSampler(profilerTag);
            this.renderPassEvent           = renderPassEvent;
            this.renderQueueType           = renderQueueType;
            this.overrideMaterial          = null;
            this.overrideMaterialPassIndex = 0;
            RenderQueueRange renderQueueRange = (renderQueueType == RenderQueueType.Transparent)
                ? RenderQueueRange.transparent
                : RenderQueueRange.opaque;

            m_FilteringSettings = new FilteringSettings(renderQueueRange, layerMask);

            if (shaderTags != null && shaderTags.Length > 0)
            {
                foreach (var passName in shaderTags)
                {
                    m_ShaderTagIdList.Add(new ShaderTagId(passName));
                }
            }
            else
            {
                m_ShaderTagIdList.Add(new ShaderTagId("SRPDefaultUnlit"));
                m_ShaderTagIdList.Add(new ShaderTagId("UniversalForward"));
                m_ShaderTagIdList.Add(new ShaderTagId("LightweightForward"));
            }

            m_RenderStateBlock = new RenderStateBlock(RenderStateMask.Nothing);
            m_CameraSettings   = cameraSettings;
        }
Exemple #2
0
        public Render2DObjectPass(Renderer2DData rendererData, RenderPassEvent renderPassEvent, string[] lightModeTags, RenderQueueType renderQueueType, int layerMask, RenderObjects.CustomCameraSettings cameraSettings)
        {
            renderFeaturePassTag = "RenderFeature " + lightModeTags[0];
            //Draw setting 相关流程
            this.renderPassEvent = renderPassEvent;
            this.renderQueueType = renderQueueType;
            RenderQueueRange renderQueueRange = (renderQueueType == RenderQueueType.Transparent) ? RenderQueueRange.transparent : RenderQueueRange.opaque;

            m_FilteringSettings = new FilteringSettings(renderQueueRange, layerMask);
            if (s_SortingLayers == null)
            {
                s_SortingLayers = SortingLayer.layers;
            }
            this.m_CameraSettings = cameraSettings;
            //Tag
            for (int i = 0; i < lightModeTags.Length; i++)
            {
                var         tag = lightModeTags[i];
                ShaderTagId sid = new ShaderTagId(tag);
                k_ShaderTags.Add(sid);
            }

            //
            m_Renderer2DData = rendererData;
        }
Exemple #3
0
 internal RenderObjectsPass(URPProfileId profileId, RenderPassEvent renderPassEvent, string[] shaderTags, RenderQueueType renderQueueType, int layerMask, RenderObjects.CustomCameraSettings cameraSettings)
 : this(profileId.GetType().Name, renderPassEvent, shaderTags, renderQueueType, layerMask, cameraSettings)
 {
     m_ProfilingSampler = ProfilingSampler.Get(profileId);
 }