don't use GL_LINEAR_MIPMAP_LINEAR for shadow maps

optimize gpu upload (use glBufferSubData instead of glMapBuffer
Avoid checking char array against zero.
This commit is contained in:
erwin coumans
2016-10-14 15:06:09 -07:00
parent 4ebc327151
commit 29f3afe2a4
23 changed files with 616 additions and 83 deletions

View File

@@ -1087,7 +1087,7 @@ bool OpenGLExampleBrowser::requestedExit()
void OpenGLExampleBrowser::update(float deltaTime)
{
B3_PROFILE("OpenGLExampleBrowser::update");
assert(glGetError()==GL_NO_ERROR);
s_instancingRenderer->init();
DrawGridData dg;
@@ -1139,9 +1139,11 @@ void OpenGLExampleBrowser::update(float deltaTime)
singleStepSimulation = false;
//printf("---------------------------------------------------\n");
//printf("Framecount = %d\n",frameCount);
B3_PROFILE("sCurrentDemo->stepSimulation");
if (gFixedTimeStep>0)
{
sCurrentDemo->stepSimulation(gFixedTimeStep);
} else
{
@@ -1167,7 +1169,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
sCurrentDemo->renderScene();
}
{
B3_PROFILE("physicsDebugDraw");
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
sCurrentDemo->physicsDebugDraw(gDebugDrawFlags);
}
@@ -1179,6 +1181,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
if (gui2 && s_guiHelper && s_guiHelper->getRenderInterface() && s_guiHelper->getRenderInterface()->getActiveCamera())
{
B3_PROFILE("setStatusBarMessage");
char msg[1024];
float camDist = s_guiHelper->getRenderInterface()->getActiveCamera()->getCameraDistance();
float pitch = s_guiHelper->getRenderInterface()->getActiveCamera()->getCameraPitch();
@@ -1194,6 +1197,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
static int toggle = 1;
if (renderGui)
{
B3_PROFILE("renderGui");
// if (!pauseSimulation)
// processProfileData(s_profWindow,false);
@@ -1202,7 +1206,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
saveOpenGLState(s_instancingRenderer->getScreenWidth(), s_instancingRenderer->getScreenHeight());
}
BT_PROFILE("Draw Gwen GUI");
if (m_internalData->m_gui)
{
m_internalData->m_gui->draw(s_instancingRenderer->getScreenWidth(), s_instancingRenderer->getScreenHeight());
@@ -1237,6 +1241,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
if (gui2)
{
B3_PROFILE("forceUpdateScrollBars");
gui2->forceUpdateScrollBars();
}