public override void Draw3D(Camera3D camera, GameObjectTag DrawTag) { base.Draw3D(camera, DrawTag); ParticleManager.ParticleDepthStencil = Microsoft.Xna.Framework.Graphics.DepthStencilState.DepthRead; ParticleManager.PreDraw(camera); ParticleManager.Draw(camera); }
public override void PreDraw() { Game1.graphicsDevice.SetRenderTarget(FinalTarget); Game1.graphicsDevice.Clear(Color.Black); #if EDITOR && WINDOWS if (!ParentLevel.LevelForEditing) #endif { Camera3D currentCamera = null; foreach (WorldViewer3D s in WorldViewerChildren) { Game1.graphicsDevice.BlendState = BlendState.Opaque; Game1.graphicsDevice.DepthStencilState = DepthStencilState.None; Render.CurrentWorldViewer3D = s; s.getSceneView().Set(); Render.CurrentView = s.getSceneView(); currentCamera = s.getCamera(); StarshipScene.CurrentCamera = currentCamera; Game1.graphicsDevice.DepthStencilState = DepthStencilState.Default; Game1.graphicsDevice.BlendState = BlendState.AlphaBlend; foreach (GameObject g in ForwardChildren) { g.Draw3D(currentCamera, GameObjectTag._3DForward); } ParticleManager.PreDraw(currentCamera); ParticleManager.Draw(currentCamera); Game1.graphicsDevice.DepthStencilState = DepthStencilState.None; Game1.graphicsDevice.BlendState = BlendState.AlphaBlend; } MasterManager.SetViewportToFullscreen(); } }
public override void PreDraw() { #if EDITOR && WINDOWS if (!ParentLevel.LevelForEditing) #endif { distortionRenderer.SetRenderTarget(); Camera3D currentCamera = null; foreach (WorldViewer3D s in WorldViewerChildren) { Render.CurrentWorldViewer3D = s; s.getSceneView().Set(); Render.CurrentView = s.getSceneView(); currentCamera = s.getCamera(); CurrentCamera = currentCamera; foreach (GameObject g in DistortionChildren) { g.Draw3D(currentCamera, GameObjectTag._3DDistortion); } InstanceManager.DrawDistortion(currentCamera); ParticleManager.DrawDistortion(currentCamera); } } Game1.graphicsDevice.SetRenderTarget(FinalTarget); Game1.graphicsDevice.Clear(Color.Black); #if EDITOR && WINDOWS if (!ParentLevel.LevelForEditing) #endif { Camera3D currentCamera = null; foreach (WorldViewer3D s in WorldViewerChildren) { Game1.graphicsDevice.BlendState = BlendState.Opaque; Game1.graphicsDevice.DepthStencilState = DepthStencilState.None; Render.CurrentWorldViewer3D = s; if (s.GetType().Equals(typeof(PlayerShip))) { DrawingShip = (PlayerShip)s; } s.getSceneView().Set(); Render.CurrentView = s.getSceneView(); currentCamera = s.getCamera(); CurrentCamera = currentCamera; foreach (GameObject g in BackgroundChildren) { g.Draw3D(currentCamera, GameObjectTag._3DBackground); } Game1.graphicsDevice.DepthStencilState = DepthStencilState.Default; Game1.graphicsDevice.BlendState = BlendState.AlphaBlend; foreach (GameObject g in ForwardChildren) { g.Draw3D(currentCamera, GameObjectTag._3DForward); } InstanceManager.DrawShield(currentCamera); ParticleManager.PreDraw(currentCamera); InstanceManager.Draw(currentCamera); ParticleManager.Draw(currentCamera); Game1.graphicsDevice.DepthStencilState = DepthStencilState.None; Game1.graphicsDevice.BlendState = BlendState.AlphaBlend; foreach (GameObject g in DepthOverChildren) { g.Draw3D(currentCamera, GameObjectTag._3DForward); } } MasterManager.SetViewportToFullscreen(); } }