From 238e474f9fef27f800eaaa8f08bea3f157c382f9 Mon Sep 17 00:00:00 2001 From: Pablo Date: Sat, 24 Jun 2017 00:40:10 -0300 Subject: [PATCH] Fix lack of water effects when using an AMD graphics card under Linux. There were two instances in the code in which the water texture was left uninitialized and this caused the caustics and reflections not to show. Apparently this only happens with the open source AMD driver on Linux. --- src/cache.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cache.h b/src/cache.h index ed40536..ecde068 100644 --- a/src/cache.h +++ b/src/cache.h @@ -410,6 +410,9 @@ struct WaterCache { caustics = new Texture(512, 512, Texture::RGB16, false); mask = new Texture(w, h, Texture::RGB16, false, m, false); delete[] m; + + Core::setTarget(data[0], true); + Core::setTarget(NULL); blank = false; @@ -571,7 +574,7 @@ struct WaterCache { while (item.timer >= SIMULATE_TIMESTEP) { // water step item.data[0]->bind(sDiffuse); - Core::setTarget(item.data[1], 0, true); + Core::setTarget(item.data[1], true); Core::setViewport(0, 0, int(item.size.x * DETAIL * 2.0f + 0.5f), int(item.size.z * DETAIL * 2.0f + 0.5f)); game->getMesh()->renderQuad(); Core::invalidateTarget(false, true); @@ -879,4 +882,4 @@ struct ZoneCache { #undef UNDERWATER_COLOR -#endif \ No newline at end of file +#endif