Пример #1
0
        public virtual void LoadContent()
        {
            spriteBatch = new SpriteBatch(graphicsDevice);
            defaultFont = Stage.Content.Load<SpriteFont>("DefaultFont");

            particleEffect = new BasicEffect(graphicsDevice);
            //particleEffect.EnableDefaultLighting();

            particleEffect.TextureEnabled = true;

            decalEffect = new DecalEffect(Stage.Content.Load<Effect>("Effects/v2/Decal"));

            sun = new Sun(Color.White.ToVector4(), new Vector4(.2f, .2f, .2f, 1.0f), 45.0f, 45.0f);

            bloom = new Bloom();
            bloom.LoadContent();
            #if DEBUG
            collisionDebugDrawer = new BEPUphysicsDrawer.Models.InstancedModelDrawer(graphicsDevice, Stage.Content.ServiceProvider);
            #endif
        }
Пример #2
0
        // called before the stage unloads content
        public virtual void UnloadContent()
        {
            if (bloom != null)
            {
                bloom.UnloadContent();
                bloom = null;
            }

            Sun.UnloadContent();
            sun = null;

            particleEffect = null;
            decalEffect = null;

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

            if (spriteBatch != null)
            {
                spriteBatch.Dispose();
                spriteBatch = null;
            }

            RModel.UnloadContent();

            ClearTables();
        }
Пример #3
0
 public void SetLights(ref DecalEffect effect)
 {
     effect.AmbientLightColor = ambientLightColor;
     effect.ShadowMap = shadowMap;
     effect.TexelSize = TexelSize;
     effect.LightViewProjections = this.LightViewProjectionMatrices;
     effect.ClipPlanes = this.LightClipPlanes;
     #if TUNE_DEPTH_BIAS
     effect.Parameters["DepthBias"].SetValue(DepthBias);
     #endif
 }