Exemplo n.º 1
0
void RenderManager::RenderAll()
//  Iterates through all the items in the render list
//  translates the render context to the object's base position then
//  renders the object.
//  Objects are drawn in order, opaque first then transparent, with transparent objects
//  further away being drawn first
{
	BuildProjectionMatrix();
	PrepareLights();
	viewMatrixMade = false;

	DrawSkyBox();
	DrawTerrain();

	std::vector<int>::iterator vit;
	if (opaqueRenderList.size() > 0) {
		for (vit = opaqueRenderList.begin(); vit != opaqueRenderList.end(); vit++) {
			if (!DrawMesh(*vit)) {
				opaqueRenderList.erase(vit);
			}
		}
	}

	DrawWater();

	std::list<int>::iterator lit;
	if (renderList.size() > 0) {
		for (lit = renderList.begin(); lit != renderList.end(); lit++) {
			if (!DrawMesh(*lit)) {
				renderList.erase(lit);
			}
		}
	}
}
void CLightingManager::LightSetup( const CViewSetup &setup )
{
	PrepareLights();

#if DEBUG
	m_bVolatileLists = true;
#endif

	CullLights();

#if DEFCFG_USE_SSE
	BuildLightSortDataBuffer();
#endif

	SortLights();

	if ( deferred_lightmanager_debug.GetInt() >= 2 )
	{
		DebugLights_Draw_Boundingboxes();
	}
}