コード例 #1
0
        public new void Draw(Graphics.Graphics graphics)
        {
            DrawBaseScene(graphics);
            DrawLights(graphics);

            graphics.GetGraphicsDeviceManager().GraphicsDevice.Clear(Color.White);
            graphics.GetSpriteBatch().Begin(blendState: Lighted.Multiply, samplerState: SamplerState.PointClamp);

            var screenRect = graphics.ScreenRectangle();
            graphics.GetSpriteBatch().Draw(BaseScene, screenRect, Color.White);
            ScreenRect = screenRect;

            if (RenderLights)
                graphics.GetSpriteBatch().Draw(LightScene, screenRect, Color.White);

            graphics.GetSpriteBatch().End();
        }
コード例 #2
0
ファイル: LightingTest.cs プロジェクト: Luigifan/Minecraft2D
        public override void Draw(Graphics.Graphics graphics)
        {
            DrawFullyLit(graphics);
            DrawLight(graphics);

            graphics.GetGraphicsDeviceManager().GraphicsDevice.Clear(Color.White);
            //graphics.GetSpriteBatch().Begin(SpriteSortMode.Deferred, Multiply, null, null, null, null, null);
            graphics.GetSpriteBatch().Begin(blendState: Multiply, sortMode: SpriteSortMode.Immediate);
            graphics.GetSpriteBatch().Draw(FullyLitWorld, graphics.ScreenRectangle(), Color.White);
            if(RenderLight)
                graphics.GetSpriteBatch().Draw(Lightpass, graphics.ScreenRectangle(), Color.White);
            graphics.GetSpriteBatch().End();
        }