Ejemplo n.º 1
0
/*
================
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
}
Ejemplo n.º 2
0
void R_RenderScene(void)
{
	R_PushDlights();
	Light_Animate();

	r_framecount++;

	R_SetupScene();

	Fog_EnableGFog(); //johnfitz

	Sky_Draw();		//johnfitz
	World_Draw();

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

	R_DrawShadows();
	R_DrawEntitiesOnList(false);
	World_DrawWater();
	R_DrawEntitiesOnList(true);
	Particle_Draw();
	Light_Draw();

	Fog_DisableGFog();

	R_DrawViewModel();
	Video_ShowBoundingBoxes();
}
Ejemplo n.º 3
0
void R_RenderModelSurfsSky (r_modelsurf_t **mslist, int numms)
{
    Fog_DisableGFog ();

    if (skybox_name[0])
    {
        // we have working skybox cubemap code now
        Sky_DrawCubeMap (mslist, numms);
    }
//	else if (gl_support_shader_objects)
//	{
//		R_RenderModelSurfsSkyPass (mslist, numms, SKY_GLSL);
//		goto glsl_sky;
//	}
    else R_RenderModelSurfsSkyPass (mslist, numms, SKY_DEPTHCLIP);

    // same pass for all sky fog just using the base verts
    if (Fog_GetDensity () > 0 && r_skyfog.value > 0)
        R_RenderModelSurfsSkyPass (mslist, numms, SKY_FOG_LAYER);

//glsl_sky:;
    if (r_showtris.value)
        R_RenderModelSurfsSkyPass (mslist, numms, SKY_SHOWTRIS);

    Fog_EnableGFog ();
}
Ejemplo n.º 4
0
/*	Called once per frame before drawing anything else
*/
void Sky_Draw(void)
{
	int	i;

	// In these special render modes, the sky faces are handled in the normal world/brush renderer
	if (r_drawflat_cheatsafe || r_lightmap_cheatsafe || !cv_video_drawsky.bValue)
		return;

	// Reset sky bounds.
	for(i = 0; i < 6; i++)
	{
		skymins[0][i] = skymins[1][i] = 9999;
		skymaxs[0][i] = skymaxs[1][i] = -9999;
	}

	// Process world and bmodels: draw flat-shaded sky surfs, and update skybounds
	Fog_DisableGFog();

	VideoLayer_Disable(VIDEO_TEXTURE_2D);

	if(Fog_GetDensity() > 0)
		glColor3fv(Fog_GetColor());
	else
		glColor3fv(skyflatcolor);

	Sky_ProcessTextureChains();
	Sky_ProcessEntities();

	glColor3f(1.0f,1.0f,1.0f);

	VideoLayer_Enable(VIDEO_TEXTURE_2D);

	// Render slow sky: cloud layers or skybox
	if(!r_fastsky.value && !(Fog_GetDensity() > 0 && r_skyfog.value >= 1))
	{
		VideoLayer_Disable(VIDEO_DEPTH_TEST);

		// By default we use a skybox.
		if(cSkyBoxName[0])
			Sky_DrawSkyBox();

		if(cv_video_drawclouds.value && gCloudTexture)
		{
			// Draw the scrolling clouds...
			for(i = 0; i < 6; i++)
				if(skymins[0][i] < skymaxs[0][i] && skymins[1][i] < skymaxs[1][i])
					Sky_DrawFace(i);
		}

		VideoLayer_Enable(VIDEO_DEPTH_TEST);
	}

	Fog_EnableGFog();

	// 3D skybox support.
	if (cl.worldmodel && (cl.worldmodel->flags & MODEL_FLAG_3DSKY))
		Sky_Draw3DWorld();
}