コード例 #1
0
        protected virtual void InternalDraw(GraphicsDevice device)
        {
            device.RasterizerState = RasterizerState.CullNone;
            if (State.CameraMode == CameraRenderMode._3D)
            {
                device.Clear(State.OutsideColor);
            }
            State.PrepareLighting();
            State._2D.OutputDepth = true;

            State._2D.Begin(this.State.Camera2D);

            //State._2D.PreciseZoom = State.PreciseZoom;
            State._2D.ResetMatrices(device.Viewport.Width, device.Viewport.Height);

            device.DepthStencilState = DepthStencilState.Default;
            if (State.CameraMode == CameraRenderMode._3D)
            {
                Static?.DrawBg(State.Device, State, SkyBounds, false);
            }
            Architecture.Draw2D(device, State);
            Static?.Draw(State);
            State.PrepareCamera();
            Entities.DrawAvatars(device, State);
            Entities.Draw(device, State);
            Entities.DrawAvatarTransparency(device, State);

            State._2D.OutputDepth = false;
        }
コード例 #2
0
        public void DrawBg(GraphicsDevice gd, WorldState state, BoundingBox[] skyBounds, bool forceSurround)
        {
            state.PrepareCamera();
            if (forceSurround || (state.CameraMode == CameraRenderMode._3D && state.Cameras.ExternalTransitionActive()) || skyBounds?.Any(x => x.Intersects(state.Frustum)) != false)
            {
                if (Dome == null)
                {
                    Dome = new SkyDomeComponent(gd, Bp);
                }
                Dome.BP = Bp;
                Dome.Draw(gd, state);

                World.Surroundings?.DrawSurrounding(gd, state.Camera, Bp.Weather.FogColor, (Bp.SubWorlds.Count > 0) ? 1 : 0);
            }
            gd.Clear(ClearOptions.DepthBuffer, Color.White, 1, 0);

            //if (((WorldCamera3D)state.Camera).FromIntensity > 0) state.CenterTile = state.CenterTile;
        }