Index: code/freespace2/freespace.cpp
===================================================================
--- code/freespace2/freespace.cpp	(revision 5726)
+++ code/freespace2/freespace.cpp	(working copy)
@@ -198,6 +198,7 @@
 
 bool Env_cubemap_drawn = false;
 
+void bars_do_frame(float frametime);
 void game_reset_view_clip();
 void game_reset_shade_frame();
 void game_post_level_init();
@@ -2812,48 +2813,6 @@
 	Cutscene_bars_progress = 1.0f;
 }
 
-void game_set_view_clip(float frametime)
-{
-	if ((Game_mode & GM_DEAD) || (supernova_active() >= 2))
-	{
-		// Set the clip region for the letterbox "dead view"
-		int yborder = gr_screen.max_h/4;
-
-		if (g3_in_frame() == 0) {
-			// Ensure that the bars are black
-			gr_set_color(0,0,0);
-			gr_rect(0, 0, gr_screen.max_w, yborder, false);
-			gr_rect(0, gr_screen.max_h-yborder, gr_screen.max_w, yborder, false);
-		} else {
-			//	Numeric constants encouraged by J "pig farmer" S, who shall remain semi-anonymous.
-			// J.S. I've changed my ways!! See the new "no constants" code!!!
-			gr_set_clip(0, yborder, gr_screen.max_w, gr_screen.max_h - yborder*2, false );	
-		}
-	}
-	else {
-		// Set the clip region for normal view
-		if ( View_percent >= 100 )	{
-			gr_reset_clip();
-		} else {
-			int xborder, yborder;
-
-			if ( View_percent < 5 )	{
-				View_percent = 5;
-			}
-
-			float fp = i2fl(View_percent)/100.0f;
-			int fi = fl2i(fl_sqrt(fp)*100.0f);
-			if ( fi > 100 ) fi=100;
-			
-			xborder = ( gr_screen.max_w*(100-fi) )/200;
-			yborder = ( gr_screen.max_h*(100-fi) )/200;
-
-			gr_set_clip(xborder, yborder, gr_screen.max_w-xborder*2,gr_screen.max_h-yborder*2, false );
-		}
-	}
-}
-
-
 void show_debug_stuff()
 {
 	int	i;
@@ -3855,14 +3814,28 @@
 int Game_subspace_effect = 0;
 DCF_BOOL( subspace, Game_subspace_effect )
 
-void clip_frame_view();
-
 // Does everything needed to render a frame
 void game_render_frame( camid cid )
 {
 
 	g3_start_frame(game_zbuffer);
 
+	// this needs to happen after g3_start_frame() and before the primary projection and view matrix is setup
+	if ( Cmdline_env && !Env_cubemap_drawn ) {
+		setup_environment_mapping(cid);
+
+		if ( !Dynamic_environment ) {
+			Env_cubemap_drawn = true;
+		}
+	}
+	gr_zbuffer_clear(TRUE);
+
+	gr_screen.gf_post_process_before();
+
+	bars_do_frame(flRealframetime);
+
+	neb2_render_setup(cid);
+
 	camera *cam = cid.getCamera();
 	matrix eye_no_jitter = vmd_identity_matrix;
 	if(cam != NULL)
@@ -3902,22 +3875,6 @@
 		shield_point_multi_setup();
 	}
 
-	// this needs to happen after g3_start_frame() and before the primary projection and view matrix is setup
-	if ( Cmdline_env && !Env_cubemap_drawn ) {
-		setup_environment_mapping(cid);
-
-		if ( !Dynamic_environment ) {
-			Env_cubemap_drawn = true;
-		}
-	}
-	gr_zbuffer_clear(TRUE);
-
-	gr_screen.gf_post_process_before();
-
-	clip_frame_view();
-
-	neb2_set_frame_backg();
-
 #ifndef DYN_CLIP_DIST
 	if (!Cmdline_nohtl) {
 		gr_set_proj_matrix(Proj_fov, gr_screen.clip_aspect, Min_draw_distance, Max_draw_distance);
@@ -4557,11 +4514,19 @@
 	gr_flash_alpha(Viewer_shader.r, Viewer_shader.g, Viewer_shader.b, Viewer_shader.c);
 }
 
+const static int DEAD_VIEW_DIVISOR = 4;
 const static int CUTSCENE_BAR_DIVISOR = 8;
 void bars_do_frame(float frametime)
 {
-	if((Cutscene_bar_flags & CUB_GRADUAL) && Cutscene_bars_progress < 1.0f)
+	if ((Game_mode & GM_DEAD) || (supernova_active() >= 2))
 	{
+		// Set the clip region for the letterbox "dead view"
+		int yborder = gr_screen.max_h/DEAD_VIEW_DIVISOR;
+
+		gr_scissor(0, yborder, gr_screen.max_w, gr_screen.max_h - yborder*2);
+	}
+	else if((Cutscene_bar_flags & CUB_GRADUAL) && Cutscene_bars_progress < 1.0f)
+	{
 		//Determine how far along we are
 		Assert(Cutscene_delta_time > 0.0f);
 
@@ -4574,51 +4539,42 @@
 		}
 
 		//Figure out where the bars should be
-		int yborder;
-		if(Cutscene_bar_flags & CUB_CUTSCENE)
+		int yborder = 0;
+		if(Cutscene_bar_flags & CUB_CUTSCENE) {
 			yborder = fl2i(Cutscene_bars_progress*(gr_screen.max_h/CUTSCENE_BAR_DIVISOR));
-		else
-			yborder = gr_screen.max_h/CUTSCENE_BAR_DIVISOR - fl2i(Cutscene_bars_progress*(gr_screen.max_h/CUTSCENE_BAR_DIVISOR));
-
-		if (g3_in_frame() == 0) {
-			//Set rectangles
-			gr_set_color(0,0,0);
-			gr_rect(0, 0, gr_screen.max_w, yborder, false);
-			gr_rect(0, gr_screen.max_h-yborder, gr_screen.max_w, yborder, false);
 		} else {
-			//Set clipping
-			gr_reset_clip();
-			gr_set_clip(0, yborder, gr_screen.max_w, gr_screen.max_h - yborder*2, false );
+			yborder = gr_screen.max_h/CUTSCENE_BAR_DIVISOR - fl2i(Cutscene_bars_progress*(gr_screen.max_h/CUTSCENE_BAR_DIVISOR));
 		}
+
+		gr_scissor(0, yborder, gr_screen.max_w, gr_screen.max_h - yborder*2);
 	}
 	else if(Cutscene_bar_flags & CUB_CUTSCENE)
 	{
 		int yborder = gr_screen.max_h/CUTSCENE_BAR_DIVISOR;
 
-		if (g3_in_frame() == 0) {
-			gr_set_color(0,0,0);
-			gr_rect(0, 0, gr_screen.max_w, yborder, false);
-			gr_rect(0, gr_screen.max_h-yborder, gr_screen.max_w, yborder, false);
-		} else {
-			gr_reset_clip();
-			gr_set_clip(0, yborder, gr_screen.max_w, gr_screen.max_h - (yborder*2), false );
-		}
+		gr_scissor(0, yborder, gr_screen.max_w, gr_screen.max_h - yborder*2);
 	}
-}
+	else
+	{
+		// Set the clip region for normal view
+		if ( View_percent >= 100 )	{
+			gr_no_scissor();
+		} else {
+			int xborder, yborder;
 
-void clip_frame_view() {
-	if(!Time_compression_locked) {
-		// Player is dead
-		game_set_view_clip(flFrametime);
+			if ( View_percent < 5 )	{
+				View_percent = 5;
+			}
 
-		// Cutscene bars
-		bars_do_frame(flRealframetime);
-	} else {
-		// Player is dead
-		game_set_view_clip(flRealframetime);
+			float fp = i2fl(View_percent)/100.0f;
+			int fi = fl2i(fl_sqrt(fp)*100.0f);
+			if ( fi > 100 ) fi=100;
+			
+			xborder = ( gr_screen.max_w*(100-fi) )/200;
+			yborder = ( gr_screen.max_h*(100-fi) )/200;
 
-		// Cutscene bars
-		bars_do_frame(flRealframetime);
+			gr_scissor(xborder, yborder, gr_screen.max_w-xborder*2,gr_screen.max_h-yborder*2);
+		}
 	}
 }
 
@@ -4766,7 +4722,7 @@
 			DEBUG_GET_TIME( render3_time1 )
 			camid cid = game_render_frame_setup();
 
-			clip_frame_view();
+			bars_do_frame(flRealframetime);
 
 			game_render_frame( cid );
 
Index: code/graphics/2d.h
===================================================================
--- code/graphics/2d.h	(revision 5726)
+++ code/graphics/2d.h	(working copy)
@@ -229,6 +229,12 @@
 	// resets the clipping region to entire screen
 	void (*gf_reset_clip)();
 
+	// sets the scissor region
+	void (*gf_scissor)(int x, int y, int w, int h);
+
+	// resets the scissor region to entire screen
+	void (*gf_no_scissor)();
+
 	//void (*gf_set_color)( int r, int g, int b );
 	//void (*gf_get_color)( int * r, int * g, int * b );
 	//void (*gf_init_color)( color * dst, int r, int g, int b );
@@ -537,6 +543,13 @@
 	(*gr_screen.gf_set_clip)(x,y,w,h,resize);
 }
 #define gr_reset_clip		GR_CALL(gr_screen.gf_reset_clip)
+
+__inline void gr_scissor(int x, int y, int w, int h)
+{
+	(*gr_screen.gf_scissor)(x,y,w,h);
+}
+#define gr_no_scissor		GR_CALL(gr_screen.gf_no_scissor)
+
 //#define gr_set_font			GR_CALL(gr_screen.gf_set_font)
 
 //#define gr_init_color		GR_CALL(gr_screen.gf_init_color)
Index: code/graphics/gropengl.cpp
===================================================================
--- code/graphics/gropengl.cpp	(revision 5726)
+++ code/graphics/gropengl.cpp	(working copy)
@@ -375,6 +375,47 @@
 #endif
 }
 
+void gr_opengl_scissor(int x, int y, int w, int h)
+{
+	// Check for sanity of parameters
+	if (x < 0)
+		x = 0;
+	if (y < 0)
+		y = 0;
+
+	int max_w = gr_screen.max_w;
+	int max_h = gr_screen.max_h;
+
+	if (x >= max_w)
+		x = max_w - 1;
+	if (y >= max_h)
+		y = max_h - 1;
+
+	if (x + w > max_w)
+		w = max_w - x;
+	if (y + h > max_h)
+		h = max_h - y;
+
+	if (w > max_w)
+		w = max_w;
+	if (h > max_h)
+		h = max_h;
+
+	// Disable scissor test if we're rendering the full screen again
+	if ( (x == 0) && (y == 0) && (w == max_w) && (h == max_h) ) {
+		glDisable(GL_SCISSOR_TEST);
+		return;
+	}
+
+	glEnable(GL_SCISSOR_TEST);
+	glScissor(x, gr_screen.max_h - y - h, w, h);
+}
+
+void gr_opengl_no_scissor()
+{
+	glDisable(GL_SCISSOR_TEST);
+}
+
 void gr_opengl_set_clip(int x, int y, int w, int h, bool resize)
 {
 	// check for sanity of parameters
@@ -1702,6 +1743,8 @@
 	gr_screen.gf_flip				= gr_opengl_flip;
 	gr_screen.gf_set_clip			= gr_opengl_set_clip;
 	gr_screen.gf_reset_clip			= gr_opengl_reset_clip;
+	gr_screen.gf_scissor			= gr_opengl_scissor;
+	gr_screen.gf_no_scissor			= gr_opengl_no_scissor;
 	
 	gr_screen.gf_clear				= gr_opengl_clear;
 //	gr_screen.gf_bitmap				= gr_opengl_bitmap;
