internal static void SetRenderTargets(Texture[] rts, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rts == null) { RestoreDefaultTargets(); } else { for (int i = 0; i < 3; i++) { if (i < rts.Length) { GraphicsDevice.SetRenderTarget(i, rts[i], 0); } else { GraphicsDevice.SetRenderTarget(i, null); } } if (depth != null) { GraphicsDevice.SetDepthStencil(depth, 0); } /* todo * else if (depthOp == SetDepthTargetEnum.RestoreDefault) * { * GraphicsDevice.DepthStencilSurface = DefaultDepth; * } */ m_renderTargetsCount = rts.Length; } }
public static void SetRenderTargets(Texture[] rts, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rts == null) { RestoreDefaultTargets(); } else { for (int i = 0; i < 3; i++) { if (i < rts.Length) { Surface surface = rts[i].GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.SetRenderTarget(i, surface); surface.Dispose(); } else { MyMinerGame.Static.GraphicsDevice.SetRenderTarget(i, null); } } if (depth != null) { Surface surface = depth.GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = surface; surface.Dispose(); } else if (depthOp == SetDepthTargetEnum.RestoreDefault) { MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = DefaultDepth; } m_renderTargetsCount = rts.Length; } }
internal static void SetRenderTarget(Texture rt, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rt == null) { RestoreDefaultTargets(); } else { GraphicsDevice.SetRenderTarget(0, rt, 0); GraphicsDevice.SetRenderTarget(1, null); GraphicsDevice.SetRenderTarget(2, null); if (depth != null) { GraphicsDevice.SetDepthStencil(depth, 0); } else if (depthOp == SetDepthTargetEnum.RestoreDefault) { if (m_screenshot != null) { GraphicsDevice.DepthStencilSurface = m_screenshot.DefaultDepth; } else { GraphicsDevice.DepthStencilSurface = DefaultDepth; } } m_renderTargetsCount = 1; } }
public static void SetRenderTarget(Texture rt, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rt == null) { RestoreDefaultTargets(); } else { Surface surface = rt.GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.SetRenderTarget(0, surface); surface.Dispose(); MyMinerGame.Static.GraphicsDevice.SetRenderTarget(1, null); MyMinerGame.Static.GraphicsDevice.SetRenderTarget(2, null); if (depth != null) { Surface dsurface = depth.GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = dsurface; dsurface.Dispose(); } else if (depthOp == SetDepthTargetEnum.RestoreDefault) { MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = DefaultDepth; } m_renderTargetsCount = 1; } }
internal static void SetRenderTargets(Texture[] rts, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rts == null) { RestoreDefaultTargets(); } else { for (int i = 0; i < 3; i++) { if (i < rts.Length) { GraphicsDevice.SetRenderTarget(i, rts[i], 0); } else GraphicsDevice.SetRenderTarget(i, null); } if (depth != null) { GraphicsDevice.SetDepthStencil(depth, 0); } /* todo else if (depthOp == SetDepthTargetEnum.RestoreDefault) { GraphicsDevice.DepthStencilSurface = DefaultDepth; } */ m_renderTargetsCount = rts.Length; } }
internal static void SetRenderTarget(Texture rt, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rt == null) { RestoreDefaultTargets(); } else { GraphicsDevice.SetRenderTarget(0, rt, 0); GraphicsDevice.SetRenderTarget(1, null); GraphicsDevice.SetRenderTarget(2, null); if (depth != null) { GraphicsDevice.SetDepthStencil(depth, 0); } else if (depthOp == SetDepthTargetEnum.RestoreDefault) { if (m_screenshot != null) GraphicsDevice.DepthStencilSurface = m_screenshot.DefaultDepth; else GraphicsDevice.DepthStencilSurface = DefaultDepth; } m_renderTargetsCount = 1; } }
public static void SetRenderTargets(Texture[] rts, Texture depth, SetDepthTargetEnum depthOp = SetDepthTargetEnum.NoChange) { if (rts == null) { RestoreDefaultTargets(); } else { for (int i = 0; i < 3; i++) { if (i < rts.Length) { Surface surface = rts[i].GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.SetRenderTarget(i, surface); surface.Dispose(); } else MyMinerGame.Static.GraphicsDevice.SetRenderTarget(i, null); } if (depth != null) { Surface surface = depth.GetSurfaceLevel(0); MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = surface; surface.Dispose(); } else if (depthOp == SetDepthTargetEnum.RestoreDefault) { MyMinerGame.Static.GraphicsDevice.DepthStencilSurface = DefaultDepth; } m_renderTargetsCount = rts.Length; } }