Example #1
0
        private void Render()
        {
            GraphicsContext.CullMode = CullMode.None;
            GraphicsContext.Clear(1.0f);

            SetFilterMode();

            _modelRenderer.SetEffect(_effect);
            _modelRenderer.SelectedAnchor = _editor.FocusAnchor;

            _effect.Technique = _techniqueHandle;
            _effect.Begin();

            _effect.BeginPass(0);

            _effect.SetMatrix("worldMat", Matrix.Identity);
            var wvpm = _viewMat * _projection;

            _effect.SetMatrix("worldViewProjMat", wvpm);

            _effect.CommitChanges();

            _ray = BasicCamera.ScreenToWorldRay(GraphicsContext, MousePosition.X, MousePosition.Y);

            RenderModel();

            _effect.SetMatrix("worldMat", Matrix.Identity);
            _effect.SetMatrix("worldViewProjMat", wvpm);
            _effect.CommitChanges();
            GraphicsContext.World      = Matrix.Identity;
            GraphicsContext.View       = _viewMat;
            GraphicsContext.Projection = _projection;

            _modelRenderer.Wireframe = false;
            _coordinateMarkerRenderer.Render(_effect);
            _modelRenderer.FloorPlane();

            _effect.EndPass();

            _effect.End();

            _guiRenderer.Render(_guiManager);

            _consoleRenderer.Render();
        }