Ejemplo n.º 1
0
        public override void Create()
        {
            FilterSettings filter = settings.filterSettings;

            // Render Objects pass doesn't support events before rendering prepasses.
            // The camera is not setup before this point and all rendering is monoscopic.
            // Events before BeforeRenderingPrepasses should be used for input texture passes (shadow map, LUT, etc) that doesn't depend on the camera.
            // These events are filtering in the UI, but we still should prevent users from changing it from code or
            // by changing the serialized data.
            if (settings.Event < RenderPassEvent.BeforeRenderingPrePasses)
            {
                settings.Event = RenderPassEvent.BeforeRenderingPrePasses;
            }

            renderObjectsPass = new RenderObjectsPass(settings.passTag, settings.Event, filter.PassNames,
                                                      filter.RenderQueueType, filter.LayerMask, settings.cameraSettings);

            renderObjectsPass.overrideMaterial          = settings.overrideMaterial;
            renderObjectsPass.overrideMaterialPassIndex = settings.overrideMaterialPassIndex;

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

            if (settings.stencilSettings.overrideStencilState)
            {
                renderObjectsPass.SetStencilState(settings.stencilSettings.stencilReference,
                                                  settings.stencilSettings.stencilCompareFunction, settings.stencilSettings.passOperation,
                                                  settings.stencilSettings.failOperation, settings.stencilSettings.zFailOperation);
            }
        }
Ejemplo n.º 2
0
        public override void Create()
        {
            FilterSettings filter = settings.filterSettings;

            renderObjectsPass = new RenderObjectsPass(settings.passTag, settings.Event, filter.PassNames,
                                                      filter.RenderQueueType, filter.LayerMask, settings.cameraSettings);

            renderObjectsPass.overrideMaterial          = settings.overrideMaterial;
            renderObjectsPass.overrideMaterialPassIndex = settings.overrideMaterialPassIndex;

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

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