Exemple #1
0
 protected override void LoadContent()
 {
     this.CombineEffect = new CombineEffect()
     {
         RedGamma = 1f
     };
 }
Exemple #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();
        }
Exemple #3
0
        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();
        }
Exemple #4
0
 public override void Initialize()
 {
     base.Initialize();
     this.combineEffect = new CombineEffect()
     {
         RedGamma = 1f
     };
     this.LevelManager.LevelChanged += (Action)(() =>
     {
         if (this.LevelManager.WaterType == LiquidType.Lava)
         {
             this.combineEffect.LeftFilter = new Matrix(1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
             this.combineEffect.RightFilter = new Matrix(0.0f, 0.0f, 0.0f, 0.0f, 1f, 0.0f, 0.0f, 0.0f, 1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
         }
         else
         {
             this.combineEffect.LeftFilter = new Matrix(0.2125f, 0.7154f, 0.0721f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
             this.combineEffect.RightFilter = new Matrix(0.0f, 0.0f, 0.0f, 0.0f, 0.2125f, 0.7154f, 0.0721f, 0.0f, 0.2125f, 0.7154f, 0.0721f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
         }
     });
 }
        public static ModelPipeline CombineDiffuseWithLighting(this ModelPipeline pipeline, CombineEffect effect)
        {
            var stage = new CombineDiffuseWithLightingStage(pipeline.Device, effect);

            pipeline.Add(stage);
            return(pipeline);
        }
Exemple #6
0
    IEnumerator ProcessCombineCell(NumberedHexaTile seed, NumberedHexaTile[] ignoreTiles)
    {
        if (seed == null || !seed.hasCell)
        {
            yield break;
        }

        Stack <CombineInfo> linkedTiles = GetCombineTree(seed, ignoreTiles);

        if (linkedTiles.Count < _minCombineCellSize)
        {
            yield break;
        }

        _lastCombinedNumber   = seed.number;
        _lastCombinedPosition = seed.transform.position;

        _score += (int)Mathf.Pow(2, seed.number) * linkedTiles.Count;

        Combine combine = _combines[_combineType];

        yield return(combine(linkedTiles));

        if (onCombineCells != null)
        {
            onCombineCells(_lastCombinedNumber, linkedTiles.Count, _combineCount);
        }

        if (_combineCount > 0)
        {
            int index = Mathf.Min(_combineCount, GameConstants.FX_COMBO.Length) - 1;
            SoundManager.Instance.PlayUISoundInstance(GameConstants.FX_COMBO[index]);
        }

        seed.cell.LeanScale(Vector3.zero, _cellCombineInterval * 0.5f).
        setEaseInBack();

        yield return(new WaitForSeconds(_cellCombineInterval * 0.5f));

        CombineEffect combineEffect = _combineEffectBuffer.Pop();

        combineEffect.transform.position = seed.transform.position + Vector3.back * 0.1f;
        combineEffect.SetColor(GameManager.instance.theme.GetCellSprite(seed.number).color);

        seed.Increase();

        seed.cell.LeanScale(Vector3.one, _cellCombineInterval * 0.5f).
        setEaseOutBack();

        yield return(new WaitForSeconds(_cellCombineInterval * 0.5f));

        ++_combineCount;

        if (seed.number <= GameConstants.HIGHEST_CELL_NUMBER)
        {
            if (seed.number > _highestNumber)
            {
                _highestNumber = seed.number;
            }

            SoundManager.Instance.PlayUISoundInstance(
                (seed.number < GameConstants.HIGHEST_CELL_NUMBER) ?
                GameConstants.FX_CELL_COMBINED :
                GameConstants.FX_CELL_COMBINED_LAST_NUMBER
                );

            yield return(ProcessCombineCell(seed, ignoreTiles));
        }
        else
        {
            SoundManager.Instance.PlayUISoundInstance(
                GameConstants.FX_CELL_COMBINED_LAST_NUMBER
                );

            yield return(new WaitForSeconds(0.25f));

            yield return(Explode(seed, 1));

            if (onReachedLastNumber != null)
            {
                onReachedLastNumber();
            }

            if (_useRemoveHighestNumber)
            {
                _highestNumber = GetCurrentHighestNumberOnBoard();
            }
        }
    }
Exemple #7
0
 public CombineDiffuseWithLightingStage(GraphicsDevice device, CombineEffect effect)
 {
     this.Device             = device;
     this.Effect             = effect;
     this.FullScreenTriangle = new FullScreenTriangle();
 }