Merge pull request #19029 from BastiaanOlij/more_viewport_texture_fixes

Fixed generating radiance texture when using viewport texture for sky
This commit is contained in:
Bastiaan Olij 2018-05-27 19:53:10 +10:00 committed by GitHub
commit 6c649bd785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -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) {

View File

@ -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;
}