Fix error spam when using PanoramaSky without texture
(cherry picked from commit 7a1b7ddf6c
)
This commit is contained in:
parent
115c0a7415
commit
c730a6ce44
|
@ -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) {
|
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)
|
ERR_FAIL_COND(!p_sky);
|
||||||
return;
|
|
||||||
|
|
||||||
RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_sky->panorama);
|
RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_sky->panorama);
|
||||||
|
|
||||||
|
@ -4337,6 +4336,7 @@ 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
|
glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for sky, only diffuse/ambient matters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (sky && sky->panorama.is_valid())
|
||||||
_draw_sky(sky, p_cam_projection, p_cam_transform, false, env->sky_custom_fov, env->bg_energy);
|
_draw_sky(sky, p_cam_projection, p_cam_transform, false, env->sky_custom_fov, env->bg_energy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue