From f4638d16f132c80a001cb79b30e16348fcaef8f6 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Sat, 19 May 2018 12:37:26 +1000 Subject: Fixed generating radiance texture when using viewport texture for sky --- drivers/gles3/rasterizer_scene_gles3.cpp | 7 +++---- drivers/gles3/rasterizer_storage_gles3.cpp | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/gles3') diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 8da2c2f9c2..03ff84c093 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2363,10 +2363,9 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C ERR_FAIL_COND(!tex); glActiveTexture(GL_TEXTURE0); - if (tex->proxy && tex->proxy->tex_id) - glBindTexture(tex->target, tex->proxy->tex_id); - else - glBindTexture(tex->target, tex->tex_id); + tex = tex->get_ptr(); //resolve for proxies + + glBindTexture(tex->target, tex->tex_id); if (storage->config.srgb_decode_supported && tex->srgb && !tex->using_srgb) { diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 85ae69f8b8..11ab957458 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1356,6 +1356,8 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra ERR_FAIL_COND(!texture); } + texture = texture->get_ptr(); //resolve for proxies + glBindVertexArray(0); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); @@ -5895,12 +5897,9 @@ void RasterizerStorageGLES3::update_particles() { tex = resources.white_tex; } break; } - } else if (t->proxy && t->proxy->tex_id) { - - target = t->proxy->target; - tex = t->proxy->tex_id; } else { + t = t->get_ptr(); //resolve for proxies target = t->target; tex = t->tex_id; } -- cgit v1.2.3