Fix error spam when using PanoramaSky without texture

(cherry picked from commit 7a1b7ddf6c)
This commit is contained in:
Poommetee Ketson 2018-02-22 21:26:35 +07:00 committed by Rémi Verschelde
parent 115c0a7415
commit c730a6ce44

View file

@ -2356,8 +2356,7 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_custom_fov, float p_energy) {
if (!p_sky)
return;
ERR_FAIL_COND(!p_sky);
RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_sky->panorama);
@ -4337,7 +4336,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for sky, only diffuse/ambient matters
*/
_draw_sky(sky, p_cam_projection, p_cam_transform, false, env->sky_custom_fov, env->bg_energy);
if (sky && sky->panorama.is_valid())
_draw_sky(sky, p_cam_projection, p_cam_transform, false, env->sky_custom_fov, env->bg_energy);
}
//_render_list_forward(&alpha_render_list,camera_transform,camera_transform_inverse,camera_projection,false,fragment_lighting,true);