Browse Source

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.
ShyRed 7 năm trước cách đây
mục cha
commit
deca3f18b7
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      drivers/gles3/rasterizer_scene_gles3.cpp

+ 5 - 1
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) {