Example #1
0
	void Renderer3D::Flush()
	{
		for (int i = 0; i < m_CommandQueue.size(); i++)
		{
			const RenderCommand& command = m_CommandQueue[i];
			command.mesh->GetMaterial()->Bind();
			SetRequiredUniforms(command.mesh->GetMaterial()->GetShader(), command.uniforms);

			command.mesh->Render();
			command.mesh->GetMaterial()->Unbind();
		}
	}
Example #2
0
	void ForwardRenderer::Present()
	{
		// TODO: Shader binding, texture sorting, visibility testing, etc.

		GLCall(glEnable(GL_DEPTH_TEST));
		GLCall(glDepthFunc(GL_LEQUAL));

		for (uint i = 0; i < m_CommandQueue.size(); i++)
		{
			const RenderCommand& command = m_CommandQueue[i];
			command.mesh->GetMaterialInstance()->GetMaterial()->GetShader()->Bind();
			SetRequiredUniforms(command.mesh->GetMaterialInstance()->GetMaterial()->GetShader(), command.uniforms);
			//SetSystemUniforms(command.mesh->GetMaterialInstance()->GetMaterial()->GetShader());
			command.mesh->Render(*this);
		}
	}