Пример #1
0
        /// <summary>
        /// Update scene globals
        /// </summary>
        /// <param name="materialPalette">Material palette</param>
        /// <param name="materialPaletteWidth">Material palette width</param>
        public static void UpdateSceneGlobals(
            EngineShaderResourceView materialPalette, uint materialPaletteWidth,
            EngineShaderResourceView animationPalette, uint animationPaletteWidth)
        {
            EffectDefaultBillboard.UpdateGlobals(
                materialPalette, materialPaletteWidth,
                GameEnvironment.LODDistanceHigh, GameEnvironment.LODDistanceMedium, GameEnvironment.LODDistanceLow);

            EffectDefaultFoliage.UpdateGlobals(
                materialPalette, materialPaletteWidth,
                GameEnvironment.LODDistanceHigh, GameEnvironment.LODDistanceMedium, GameEnvironment.LODDistanceLow);

            EffectDefaultBasic.UpdateGlobals(
                materialPalette, materialPaletteWidth,
                animationPalette, animationPaletteWidth,
                GameEnvironment.LODDistanceHigh, GameEnvironment.LODDistanceMedium, GameEnvironment.LODDistanceLow);
            EffectDefaultTerrain.UpdateGlobals(
                materialPalette, materialPaletteWidth,
                GameEnvironment.LODDistanceHigh, GameEnvironment.LODDistanceMedium, GameEnvironment.LODDistanceLow);

            EffectDeferredBasic.UpdateGlobals(animationPalette, animationPaletteWidth);
            EffectDeferredComposer.UpdateGlobals(
                materialPalette, materialPaletteWidth,
                GameEnvironment.LODDistanceHigh, GameEnvironment.LODDistanceMedium, GameEnvironment.LODDistanceLow);

            EffectShadowCascade.UpdateGlobals(animationPalette, animationPaletteWidth);

            EffectShadowBasic.UpdateGlobals(animationPalette, animationPaletteWidth);

            EffectShadowPoint.UpdateGlobals(animationPalette, animationPaletteWidth);
        }
Пример #2
0
        /// <summary>
        /// Dispose of used resources
        /// </summary>
        public static void DisposeResources()
        {
            EffectNull?.Dispose();
            EffectNull = null;

            EffectDefaultSprite?.Dispose();
            EffectDefaultSprite = null;
            EffectDefaultFont?.Dispose();
            EffectDefaultFont = null;
            EffectDefaultCubemap?.Dispose();
            EffectDefaultCubemap = null;
            EffectDefaultBillboard?.Dispose();
            EffectDefaultBillboard = null;
            EffectDefaultFoliage?.Dispose();
            EffectDefaultFoliage = null;
            EffectDefaultClouds?.Dispose();
            EffectDefaultClouds = null;
            EffectDefaultBasic?.Dispose();
            EffectDefaultBasic = null;
            EffectDefaultTerrain?.Dispose();
            EffectDefaultTerrain = null;
            EffectDefaultSkyScattering?.Dispose();
            EffectDefaultSkyScattering = null;
            EffectDefaultCPUParticles?.Dispose();
            EffectDefaultCPUParticles = null;
            EffectDefaultGPUParticles?.Dispose();
            EffectDefaultGPUParticles = null;
            EffectDefaultWater?.Dispose();
            EffectDefaultWater = null;

            EffectDeferredComposer?.Dispose();
            EffectDeferredComposer = null;
            EffectDeferredBasic?.Dispose();
            EffectDeferredBasic = null;
            EffectDeferredTerrain?.Dispose();
            EffectDeferredTerrain = null;

            EffectShadowBillboard?.Dispose();
            EffectShadowBillboard = null;
            EffectShadowFoliage?.Dispose();
            EffectShadowFoliage = null;
            EffectShadowBasic?.Dispose();
            EffectShadowBasic = null;
            EffectShadowTerrain?.Dispose();
            EffectShadowTerrain = null;
            EffectShadowPoint?.Dispose();
            EffectShadowPoint = null;
            EffectShadowCascade?.Dispose();
            EffectShadowCascade = null;

            EffectPostBlur?.Dispose();
            EffectPostBlur = null;
        }