Changing in which order stuff is drawn.
This commit is contained in:
parent
63acfef341
commit
8f6c27ae32
@ -474,13 +474,28 @@ void Graphics::render(double time)
|
|||||||
lightingShader->setUniform("movement", wind);
|
lightingShader->setUniform("movement", wind);
|
||||||
|
|
||||||
lightingShader->setUniform("time", (float) time);
|
lightingShader->setUniform("time", (float) time);
|
||||||
|
|
||||||
|
|
||||||
if (renderWorld) {
|
if (renderWorld) {
|
||||||
// render the level
|
// render the level
|
||||||
level->render(lightingShader, true, &lightingViewProjectionMatrix, &depthBiasVPs);
|
level->render(lightingShader, true, &lightingViewProjectionMatrix, &depthBiasVPs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (renderDebug) {
|
||||||
|
debugDrawer.setDebugMode(btIDebugDraw::DBG_DrawWireframe);
|
||||||
|
level->getPhysics()->getWorld()->debugDrawWorld();
|
||||||
|
debugDrawer.setDebugMode(btIDebugDraw::DBG_NoDebug);
|
||||||
|
unsigned int data_count = debugDrawer.getData()->size();
|
||||||
|
float* debugData = new float[data_count];
|
||||||
|
for (unsigned int i = 0; i<data_count; i++) {
|
||||||
|
debugData[i] = debugDrawer.getData()->at(i);
|
||||||
|
}
|
||||||
|
debug_ab->setDataElements(data_count/6, debugData);
|
||||||
|
debugDrawer.clearData();
|
||||||
|
debugShader->use();
|
||||||
|
debugShader->setUniform("viewProjectionMatrix", lightingViewProjectionMatrix);
|
||||||
|
debug_vao->render();
|
||||||
|
}
|
||||||
|
|
||||||
// draw flames on top
|
// draw flames on top
|
||||||
if (renderFlames) {
|
if (renderFlames) {
|
||||||
flameShader->use();
|
flameShader->use();
|
||||||
@ -528,21 +543,6 @@ void Graphics::render(double time)
|
|||||||
glBlitFramebuffer(0, 0, windowSize.x, windowSize.y, 0, 0, windowSize.x, windowSize.y,
|
glBlitFramebuffer(0, 0, windowSize.x, windowSize.y, 0, 0, windowSize.x, windowSize.y,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
}
|
}
|
||||||
if (renderDebug) {
|
|
||||||
debugDrawer.setDebugMode(btIDebugDraw::DBG_DrawWireframe);
|
|
||||||
level->getPhysics()->getWorld()->debugDrawWorld();
|
|
||||||
debugDrawer.setDebugMode(btIDebugDraw::DBG_NoDebug);
|
|
||||||
unsigned int data_count = debugDrawer.getData()->size();
|
|
||||||
float* debugData = new float[data_count];
|
|
||||||
for (unsigned int i = 0; i<data_count; i++) {
|
|
||||||
debugData[i] = debugDrawer.getData()->at(i);
|
|
||||||
}
|
|
||||||
debug_ab->setDataElements(data_count/6, debugData);
|
|
||||||
debugDrawer.clearData();
|
|
||||||
debugShader->use();
|
|
||||||
debugShader->setUniform("viewProjectionMatrix", lightingViewProjectionMatrix);
|
|
||||||
debug_vao->render();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user