コード例 #1
0
        public ShadowMapSystem(
            GraphicsDevice device,
            IComponentContainer <ShadowMap> shadowMaps,
            ModelSystem modelSystem,
            AveragedParticleSystem particleSystem,
            IMeterRegistry meterRegistry)
        {
            this.Device         = device;
            this.ShadowMaps     = shadowMaps;
            this.ModelSystem    = modelSystem;
            this.ParticleSystem = particleSystem;
            this.MeterRegistry  = meterRegistry;

            this.MeterRegistry.CreateGauge(ShadowMapCounter);
            this.MeterRegistry.CreateGauge(ShadowMapTotal);
            this.MeterRegistry.CreateGauge(ShadowMapStep, "step");

            this.NullSkybox = new TextureCube(device, 1, false, SurfaceFormat.Color);
            this.NullSkybox.SetData(CubeMapFace.PositiveX, new Color[] { Color.White });
            this.NullSkybox.SetData(CubeMapFace.NegativeX, new Color[] { Color.White });
            this.NullSkybox.SetData(CubeMapFace.PositiveY, new Color[] { Color.White });
            this.NullSkybox.SetData(CubeMapFace.NegativeY, new Color[] { Color.White });
            this.NullSkybox.SetData(CubeMapFace.PositiveZ, new Color[] { Color.White });
            this.NullSkybox.SetData(CubeMapFace.NegativeZ, new Color[] { Color.White });
        }
コード例 #2
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();
        }
コード例 #3
0
        public static ParticlePipeline RenderTransparentParticles(
            this ParticlePipeline pipeline,
            AveragedParticleSystem particleSystem)
        {
            var stage = new RenderTransparentParticlesStage(pipeline.Device, particleSystem);

            pipeline.Add(stage);
            return(pipeline);
        }
コード例 #4
0
ファイル: ShadowMapSystem.cs プロジェクト: third1020/MiniRTS
        public ShadowMapSystem(
            GraphicsDevice device,
            IComponentContainer <ShadowMap> shadowMaps,
            ModelSystem modelSystem,
            AveragedParticleSystem particleSystem,
            IMeterRegistry meterRegistry)
        {
            this.Device         = device;
            this.ShadowMaps     = shadowMaps;
            this.ModelSystem    = modelSystem;
            this.ParticleSystem = particleSystem;
            this.MeterRegistry  = meterRegistry;

            this.MeterRegistry.CreateGauge(ShadowMapCounter);
            this.MeterRegistry.CreateGauge(ShadowMapTotal);
            this.MeterRegistry.CreateGauge(ShadowMapStep, "step");
        }
コード例 #5
0
ファイル: PipelineBuilder.cs プロジェクト: 0000duck/MiniRTS
        public PipelineBuilder(GraphicsDevice device, ShadowMapSystem shadowMapSystem, ModelSystem modelSystem, AveragedParticleSystem transparentParticleSystem, AdditiveParticleSystem additiveParticleSystem, ProjectorSystem projectorSystem, EffectFactory effectFactory, AmbientLightSystem ambientLightSystem, DirectionalLightSystem directionalLightSystem, PointLightSystem pointLightSystem, CascadedShadowMapSystem cascadedShadowMapSystem, ShadowCastingLightSystem shadowCastingLightSystem, SunlightSystem sunlightSystem, IconSystem iconSystem)
        {
            this.Device                    = device;
            this.ShadowMapSystem           = shadowMapSystem;
            this.ModelSystem               = modelSystem;
            this.TransparentParticleSystem = transparentParticleSystem;
            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.IconSystem                = iconSystem;

            this.MeterRegistry = new NullMeterRegistry();
        }
コード例 #6
0
 public RenderTransparentParticlesStage(GraphicsDevice device, AveragedParticleSystem particleSystem)
 {
     this.Device         = device;
     this.ParticleSystem = particleSystem;
 }