Ejemplo n.º 1
0
        public static ModelPipeline RenderProjectors(this ModelPipeline pipeline, ProjectorPipeline projectorPipeline)
        {
            var stage = new RenderProjectorsStage(projectorPipeline);

            pipeline.Add(stage);

            return(pipeline);
        }
Ejemplo n.º 2
0
        public static ProjectorPipeline RenderProjectors(this ProjectorPipeline pipeline, ProjectorSystem projectorSystem)
        {
            var stage = new RenderProjectorsInternalStage(pipeline.Device, projectorSystem);

            pipeline.Add(stage);

            return(pipeline);
        }
Ejemplo n.º 3
0
        public DeferredRenderPipeline(
            GraphicsDevice device,
            ShadowMapSystem shadowMapSystem,
            ModelSystem modelSystem,
            AveragedParticleSystem particleSystem,
            AdditiveParticleSystem additiveParticleSystem,
            ProjectorSystem projectorSystem,
            EffectFactory effectFactory,
            AmbientLightSystem ambientLightSystem,
            DirectionalLightSystem directionalLightSystem,
            PointLightSystem pointLightSystem,
            CascadedShadowMapSystem cascadedShadowMapSystem,
            ShadowCastingLightSystem shadowCastingLightSystem,
            SunlightSystem sunlightSystem,
            BoundarySystem boundarySystem,
            DynamicTextureSystem dynamicTextureSystem,
            IconSystem iconSystem,
            CutsceneSystem cutsceneSystem,
            IMeterRegistry meterRegistry)
        {
            this.ShadowMapSystem           = shadowMapSystem;
            this.ModelSystem               = modelSystem;
            this.TransparentParticleSystem = particleSystem;
            this.AdditiveParticleSystem    = additiveParticleSystem;
            this.ProjectorSystem           = projectorSystem;
            this.CombineEffect             = effectFactory.Construct <CombineEffect>();
            this.FxaaEffect               = effectFactory.Construct <FxaaEffect>();
            this.AmbientLightSystem       = ambientLightSystem;
            this.DirectionalLightSystem   = directionalLightSystem;
            this.PointLightSystem         = pointLightSystem;
            this.CascadedShadowMapSystem  = cascadedShadowMapSystem;
            this.ShadowCastingLightSystem = shadowCastingLightSystem;
            this.SunlightSystem           = sunlightSystem;
            this.BoundarySystem           = boundarySystem;
            this.DynamicTextureSystem     = dynamicTextureSystem;
            this.CutsceneSystem           = cutsceneSystem;
            this.IconSystem               = iconSystem;

            var width  = device.PresentationParameters.BackBufferWidth;
            var height = device.PresentationParameters.BackBufferHeight;

            this.GBuffer = new GBuffer(device, width, height);

            this.Input = new RenderPipelineInput();

            this.Settings = new RenderPipelineSettings();

            this.ShadowPipeline    = ShadowPipeline.Create(device, meterRegistry);
            this.LightingPipeline  = LightingPipeline.Create(device, meterRegistry);
            this.ModelPipeline     = ModelPipeline.Create(device, meterRegistry);
            this.ParticlePipeline  = ParticlePipeline.Create(device, meterRegistry);
            this.ProjectorPipeline = ProjectorPipeline.Create(device, meterRegistry);

            this.Pipeline = RenderPipeline.Create(device, meterRegistry);
            this.RootPass = new Pass(PassType.Opaque, 0);

            this.Recreate();
        }
Ejemplo n.º 4
0
        private void AddModels(RenderPipeline pipeline, GraphicsDevice device, IMeterRegistry meterRegistry, RenderPipelineSettings settings)
        {
            if (settings.EnableModels)
            {
                pipeline.UpdateSystem(this.Systems.Get <BoundsSystem>());

                var modelPipeline = ModelPipeline.Create(device, meterRegistry)
                                    .ClearModelRenderTargets()
                                    .RenderGeometry(this.Systems.Get <GeometrySystem>())
                                    .RenderModelBatch();

                if (settings.EnableProjectors)
                {
                    var projectorPipeline = ProjectorPipeline.Create(device, meterRegistry);
                    var projectorSystem   = this.Systems.Get <ProjectorSystem>();
                    projectorSystem.Technique = settings.ProjectorTechnique;
                    projectorPipeline.RenderProjectors(projectorSystem);

                    modelPipeline.RenderProjectors(projectorPipeline);
                }

                if (EnableLights(settings))
                {
                    var ls = settings.LightSettings;
                    var lightingPipeline = LightingPipeline.Create(device, meterRegistry)
                                           .ClearLightTargets()
                                           .EnableIf(ls.EnableAmbientLights, x => x.RenderAmbientLight(this.Systems.Get <AmbientLightSystem>(), ls.EnableSSAO))
                                           .EnableIf(ls.EnableDirectionalLights, x => x.RenderDirectionalLights(this.Systems.Get <DirectionalLightSystem>()))
                                           .EnableIf(ls.EnablePointLights, x => x.RenderPointLights(this.Systems.Get <PointLightSystem>()))
                                           .EnableIf(ls.EnableShadowCastingLights, x => x.RenderShadowCastingLights(this.Systems.Get <ShadowCastingLightSystem>()))
                                           .EnableIf(ls.EnableSunLights, x => x.RenderSunlights(this.Systems.Get <SunlightSystem>()));

                    modelPipeline.RenderLights(lightingPipeline);
                }

                var combineEffect = this.EffectFactory.Construct <CombineEffect>();
                var fxaaEffect    = this.EffectFactory.Construct <FxaaEffect>();
                modelPipeline
                .CombineDiffuseWithLighting(combineEffect)
                .AntiAlias(fxaaEffect, settings.ModelSettings.FxaaFactor);

                pipeline.RenderModels(this.Systems.Get <ModelSystem>(), modelPipeline);
            }
        }
Ejemplo n.º 5
0
        public void AddAll(RenderPipeline pipeline)
        {
            var shadowPipeline    = ShadowPipeline.Create(this.Device, this.MeterRegistry);
            var lightingPipeline  = LightingPipeline.Create(this.Device, this.MeterRegistry);
            var modelPipeline     = ModelPipeline.Create(this.Device, this.MeterRegistry);
            var particlePipeline  = ParticlePipeline.Create(this.Device, this.MeterRegistry);
            var projectorPipeline = ProjectorPipeline.Create(this.Device, this.MeterRegistry);


            shadowPipeline
            .RenderShadowMaps(this.ShadowMapSystem);

            lightingPipeline
            .ClearLightTargets()
            .RenderAmbientLight(this.AmbientLightSystem, true)
            .RenderDirectionalLights(this.DirectionalLightSystem)
            .RenderPointLights(this.PointLightSystem)
            .RenderShadowCastingLights(this.ShadowCastingLightSystem)
            .RenderSunlights(this.SunlightSystem);

            projectorPipeline
            .RenderProjectors(this.ProjectorSystem);
            this.ProjectorSystem.Technique = Effects.Techniques.ProjectorEffectTechniques.Projector;

            modelPipeline
            .ClearModelRenderTargets()
            .RenderModelBatch()
            .RenderProjectors(projectorPipeline)
            .RenderLights(lightingPipeline)
            .CombineDiffuseWithLighting(this.CombineEffect)
            .AntiAlias(this.FxaaEffect, 4);

            particlePipeline
            .ClearParticleRenderTargets()
            .RenderTransparentParticles(this.TransparentParticleSystem)
            .RenderAdditiveParticles(this.AdditiveParticleSystem);

            pipeline
            .ClearRenderTargetSet()
            .RenderShadows(shadowPipeline)
            .RenderModels(this.ModelSystem, modelPipeline)
            .RenderParticles(particlePipeline);
        }
Ejemplo n.º 6
0
 internal createInjester(ProjectorPipeline <Ingestion.Ingester <IEnumerable <StreamEvent <byte[]> >, Submission.SubmissionBatch <StreamEvent <byte[]> > > > objectArg)
 {
     this.objectArg = objectArg;
 }
Ejemplo n.º 7
0
            public override IChangeFeedObserver Invoke(Unit unitVar0)
            {
                ILogger logger = Log.Logger;
                ProjectorPipeline <Ingestion.Ingester <IEnumerable <StreamEvent <byte[]> >, Submission.SubmissionBatch <StreamEvent <byte[]> > > > objectArg = projector;

                return(CosmosSource.CreateObserver(logger, new createInjester(projector), new createMapper()));
            }
Ejemplo n.º 8
0
 internal createObserver(ProjectorPipeline <Ingestion.Ingester <IEnumerable <StreamEvent <byte[]> >, Submission.SubmissionBatch <StreamEvent <byte[]> > > > projector)
 {
     this.projector = projector;
 }
Ejemplo n.º 9
0
 public RenderProjectorsStage(ProjectorPipeline projectorPipeline)
 {
     this.ProjectorPipeline = projectorPipeline;
     this.Input             = new ProjectorPipelineInput();
 }