public void Render() { Device.EndScene(); Surf.Dispose(); Device.SetRenderTarget(0, OldRenderTarget); Device.DepthStencilSurface = OldDepthStencil; Device.BeginScene(); Device.VertexFormat = CustomVertex.PositionTextured.Format; Device.SetStreamSource(0, FullScreenQuad, 0); Effect.SetValue("render_target2D", RenderTarget2D); if (RenderTeleportEffect) { Effect.Technique = "Darken"; Effect.SetValue("time", Time); } else { Time = 0; if (RenderAlarmEffect) { Effect.Technique = "AlarmTechnique"; Effect.SetValue("alarmScaleFactor", IntVaivenAlarm.update(ElapsedTime)); } else { Effect.Technique = "DivingHelmet"; } } if (RenderPDA) { Effect.Technique = "PDA"; } Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1f, 0); Effect.Begin(FX.None); Effect.BeginPass(0); Device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2); Effect.EndPass(); Effect.End(); }