summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShyRed <ShyRed@users.noreply.github.com>2018-04-12 22:51:35 +0200
committerShyRed <ShyRed@users.noreply.github.com>2018-04-12 22:51:35 +0200
commitdeca3f18b777f1e3a71f8cb12c5f5fa329aa70cd (patch)
treede3d7020bfa5288d0accec1a5cb648a40f5f9d6f /drivers
parent3a5b25d5b489ad88c2861c9c37b56469580fbf03 (diff)
Fix binding of ViewportTexture to Sky
In order to the get the actual rendered image from a ViewportTexture the sky needs to access the proxy texture.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 5b6b3d44f2..5fa848e3af 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2362,7 +2362,11 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C
ERR_FAIL_COND(!tex);
glActiveTexture(GL_TEXTURE0);
- glBindTexture(tex->target, tex->tex_id);
+
+ if (tex->proxy && tex->proxy->tex_id)
+ glBindTexture(tex->target, tex->proxy->tex_id);
+ else
+ glBindTexture(tex->target, tex->tex_id);
if (storage->config.srgb_decode_supported && tex->srgb && !tex->using_srgb) {