Example #1
0
/*
================
R_RenderScene

RI.refdef must be set before the first call
================
*/
void R_RenderScene( const ref_params_t *fd )
{
	RI.refdef = *fd;

	if( !cl.worldmodel && RI.drawWorld )
		Host_Error( "R_RenderScene: NULL worldmodel\n" );

	R_PushDlights();

	R_SetupFrame();
	R_SetupFrustum();
	R_SetupGL();
	R_Clear( ~0 );

	R_MarkLeaves();
	R_CheckFog();
	R_DrawWorld();

	CL_ExtraUpdate ();	// don't let sound get messed up if going slow

	R_DrawEntitiesOnList();

	R_DrawWaterSurfaces();

	R_EndGL();
}
/*
================
R_RenderScene
================
*/
void R_RenderScene (void)
{
	R_SetupScene (); //johnfitz -- this does everything that should be done once per call to RenderScene

	Fog_EnableGFog (); //johnfitz

	Sky_DrawSky (); //johnfitz

	R_DrawWorld ();

	S_ExtraUpdate (); // don't let sound get messed up if going slow

	R_DrawShadows (); //johnfitz -- render entity shadows

	R_DrawEntitiesOnList (false); //johnfitz -- false means this is the pass for nonalpha entities

	R_DrawTextureChains_Water (); //johnfitz -- drawn here since they might have transparency

	R_DrawEntitiesOnList (true); //johnfitz -- true means this is the pass for alpha entities

	R_RenderDlights (); //triangle fan dlights -- johnfitz -- moved after water

	R_DrawParticles ();

	Fog_DisableGFog (); //johnfitz

	R_DrawViewModel (); //johnfitz -- moved here from R_RenderView

	R_ShowTris (); //johnfitz

	R_ShowBoundingBoxes (); //johnfitz
}
Example #3
0
/*
================
R_RenderScene

r_refdef must be set before the first call
================
*/
void R_RenderScene (void)
{
	R_SetupFrame ();

	R_SetFrustum ();

	R_SetupGL ();

	R_MarkLeaves ();	// done here so we know if we're in water

	R_DrawWorld ();		// adds static entities to the list

	S_ExtraUpdate ();	// don't let sound get messed up if going slow

	R_DrawEntitiesOnList ();

	GL_DisableMultitexture();

	R_RenderDlights ();

	R_DrawParticles ();

#ifdef GLTEST
	Test_Draw ();
#endif

}
Example #4
0
/*
================
R_RenderScene

r_refdef must be set before the first call
================
*/
void R_RenderScene (void)
{
	R_SetupFrame ();

	R_SetFrustum ();

	R_SetupGL ();
	
	R_MarkLeaves ();	// done here so we know if we're in water

	/* Experimenting with lighting.
	glEnable(GL_LIGHTING);
	glShadeModel(GL_SMOOTH);
	glEnable(GL_LIGHT0);
	glEnable(GL_COLOR_MATERIAL);
	GLfloat specular[4] = {1, 1, 1, 1};
	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular);
	int li = 0;
	
	for (; li < 8; li += 1)
	{
		if (cl_dlights[li].die >= cl.time && cl_dlights[li].radius)
		{
			GLfloat pos[4] = { cl_dlights[li].origin[0], cl_dlights[li].origin[1], cl_dlights[li].origin[2], 1.0};
			glLightfv(GL_LIGHT0+li, GL_POSITION, pos);
			glLightf(GL_LIGHT0+li, GL_CONSTANT_ATTENUATION, 0.1);
			glEnable(GL_LIGHT0+li);
		}
		else
		{
			break;
		}
	}
	*/
	R_DrawWorld ();		// adds static entities to the list

	S_ExtraUpdate ();	// don't let sound get messed up if going slow

	/*for (li -=1; li >= 0; li -= 1)
	{
		glDisable(GL_LIGHT0+li);
	}
	glDisable(GL_LIGHTING);*/
	
	R_DrawEntitiesOnList ();
	
	GL_DisableMultitexture();

	R_RenderDlights ();

	R_DrawParticles ();

#ifdef GLTEST
	Test_Draw ();
#endif

}
/**
 * \brief Draw the console on the screen.
 */
PUBLIC void Client_Screen_DrawConsole( void )
{
    if( r_world != NULL )
    {
        R_DrawWorld();
    }

	Con_CheckResize();
	
	if( ClientStatic.state == ca_disconnected || ClientStatic.state == ca_connecting )
	{	// forced full screen console
		Con_DrawConsole( 1.0 );
		return;
	}

	if( ClientStatic.state != ca_active )// || !ClientState.refresh_prepped )
	{	// connected, but can't render
		Con_DrawConsole( 0.5 );
		R_Draw_Fill( 0, viddef.height >> 1, viddef.width, viddef.height >> 1, colourBlack );
		return;
	}
Example #6
0
// render frame (3-D part) ----------------------------------------------------
//
INLINE
void Gm_RenderFrame()
{
	// maintain sound
	AUDs_MaintainSound();

	// reset polygon count
	NumRenderedPolygons = 0;

	// next visframe
	CurVisibleFrame++;
	if ( CurVisibleFrame == VISFRAME_NEVER ) {
		CurVisibleFrame = VISFRAME_START;
	}

	// viewcam for 3-D frame
	CAMERA_BeginFrameView();

	// transform frustum into world-space
	BackTransformVolume( ViewCamera, View_Volume, World_ViewVolume, 0x3f );
	CULL_MakeVolumeCullVolume( World_ViewVolume, World_CullVolume, 0x3f );

	// draw fixed stars/panorama
	Gm_DrawFixedStars();

	// draw pseudo stars
	Gm_DrawPseudoStars();

	// local ship always considered visible
	MyShip->VisibleFrame = CurVisibleFrame;

	// determine visible polygonal objects
	ScanActiveObjects( ViewCamera );

	CHECKMEMINTEGRITY();
	CHECKLISTINTEGRITY();

	// walk callbacks before drawing world objects
	CALLBACK_WalkCallbacks( CBTYPE_DRAW_OBJECTS );

	// draw visible polygonal objects
	R_DrawWorld( ViewCamera );

	// walk callbacks before drawing particles
	CALLBACK_WalkCallbacks( CBTYPE_DRAW_PARTICLES );

	// draw visible particles
	R_DrawParticles();

	// walk callbacks for custom iter objects
	CALLBACK_WalkCallbacks( CBTYPE_DRAW_CUSTOM_ITER );

	// walk callbacks before drawing effects
	CALLBACK_WalkCallbacks( CBTYPE_DRAW_EFFECTS );

	// draw lens flare
	R_DrawLensFlare();

	// standard viewcam
	CAMERA_EndFrameView();

	// maintain sound
	AUDs_MaintainSound();
}