Ejemplo n.º 1
0
// if frustum is NULL, don't do frustum or contribution culling
void GraphicsGL3::AssembleDrawList(const std::vector <Drawable*> & drawables, std::vector <RenderModelExt*> & out, Frustum * frustum, const Vec3 & camPos)
{
    if (frustum && enableContributionCull)
    {
        for (std::vector <Drawable*>::const_iterator i = drawables.begin(); i != drawables.end(); i++)
        {
            if (!frustumCull(*i, *frustum) && !contributionCull(*i, camPos))
                out.push_back(&(*i)->GenRenderModelData(stringMap));
        }
    }
    else if (frustum)
    {
        for (std::vector <Drawable*>::const_iterator i = drawables.begin(); i != drawables.end(); i++)
        {
            if (!frustumCull(*i, *frustum))
                out.push_back(&(*i)->GenRenderModelData(stringMap));
        }
    }
    else
    {
        for (std::vector <Drawable*>::const_iterator i = drawables.begin(); i != drawables.end(); i++)
        {
            out.push_back(&(*i)->GenRenderModelData(stringMap));
        }
    }
}
Ejemplo n.º 2
0
	void render( eRenderMode rm )
	{
		updateWVPMatrices();
		if( frustumCull() )
			return;
		G_RENDERCTX->attach( *mRenderMeshes[rm] );
	}