コード例 #1
0
        public RenderPortalPass(string profilerTag, UnityEngine.Rendering.Universal.RenderPassEvent renderPassEvent, string[] shaderTags,
                                RenderQueueType renderQueueType, int layerMask, PortalRenderPassFeature.CustomCameraSettings cameraSettings, PortalRenderContext portalContext)
        {
            m_ProfilerTag                  = 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);
            portalRenderContext = portalContext;

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

            m_RenderStateBlock = new RenderStateBlock(RenderStateMask.Nothing);
            m_CameraSettings   = cameraSettings;
        }
コード例 #2
0
        public override void Create()
        {
            portalRenderContext?.Dispose();
            portalRenderContext            = new PortalRenderContext();
            portalRenderContext.exitPortal = settings.exitPortal;

            FilterSettings filter = settings.filterSettings;

            renderPortalPass = new RenderPortalPass(settings.passTag, settings.Event, filter.PassNames,
                                                    filter.RenderQueueType, filter.LayerMask, settings.cameraSettings, portalRenderContext);

            renderPortalPass.overrideMaterial          = settings.overrideMaterial;
            renderPortalPass.overrideMaterialPassIndex = settings.overrideMaterialPassIndex;

            if (settings.overrideDepthState)
            {
                renderPortalPass.SetDetphState(settings.enableWrite, settings.depthCompareFunction);
            }

            if (settings.stencilSettings.overrideStencilState)
            {
                renderPortalPass.SetStencilState(settings.stencilSettings.stencilReference,
                                                 settings.stencilSettings.stencilCompareFunction, settings.stencilSettings.passOperation,
                                                 settings.stencilSettings.failOperation, settings.stencilSettings.zFailOperation);
            }

            //setupPortalBufferRenderPass = new SetupPortalBufferRenderPass("SetupPortalBuffer", portalRenderContext);
            Debug.Log("Created new portalrendererpass instance");
        }
コード例 #3
0
        public SetupPortalBufferRenderPass(string profilerTag, PortalRenderContext portalRenderContext)
        {
            m_ProfilerTag        = profilerTag;
            this.renderPassEvent = UnityEngine.Rendering.Universal.RenderPassEvent.BeforeRendering;

            this.portalRenderContext = portalRenderContext;
        }