1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

water render before world render

This commit is contained in:
Oleksii Leleka 2019-08-18 02:41:26 +03:00 committed by Filip Gawin
parent c7d77084c2
commit ed74f11d39
2 changed files with 7 additions and 6 deletions

View File

@ -235,15 +235,15 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
culled = 0;
renderObjects(world);
renderer->pushDebugGroup("Water");
renderer->pushDebugGroup("Water");
water.render(*this, world);
water.render(*this, world);
profWater = renderer->popDebugGroup();
renderer->pushDebugGroup("Sky");
renderObjects(world);
renderer->pushDebugGroup("Sky");
glBindVertexArray(vao);

View File

@ -132,7 +132,7 @@ void WaterRenderer::render(GameRenderer &renderer, GameWorld* world) {
glStencilFunc(GL_EQUAL, 1, 0xFF);
glStencilMask(0x00);
glEnable(GL_DEPTH_TEST);
glDisable(GL_DEPTH_TEST);
r.useProgram(waterProg.get());
@ -152,4 +152,5 @@ void WaterRenderer::render(GameRenderer &renderer, GameWorld* world) {
r.drawArrays(m, &gridDraw, wdp);
glDisable(GL_STENCIL_TEST);
glEnable(GL_DEPTH_TEST);
}