summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_scene_gles3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/rasterizer_scene_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 14c436fd00..ed2b39a17d 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -653,7 +653,7 @@ bool RasterizerSceneGLES3::reflection_probe_instance_begin_render(RID p_instance
int best_free = -1;
int best_used = -1;
- uint64_t best_used_frame;
+ uint64_t best_used_frame = 0;
for (int i = 0; i < reflection_atlas->reflections.size(); i++) {
if (reflection_atlas->reflections[i].owner == RID()) {
@@ -2519,7 +2519,7 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C
storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_PANORAMA, false);
}
-void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatrix &p_cam_projection, const Transform &p_cam_transform) {
+void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatrix &p_cam_projection, const Transform &p_cam_transform, bool p_no_fog) {
//store camera into ubo
store_camera(p_cam_projection, state.ubo_data.projection_matrix);
@@ -2570,7 +2570,7 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
state.ubo_data.fog_color_enabled[0] = linear_fog.r;
state.ubo_data.fog_color_enabled[1] = linear_fog.g;
state.ubo_data.fog_color_enabled[2] = linear_fog.b;
- state.ubo_data.fog_color_enabled[3] = env->fog_enabled ? 1.0 : 0.0;
+ state.ubo_data.fog_color_enabled[3] = (!p_no_fog && env->fog_enabled) ? 1.0 : 0.0;
Color linear_sun = env->fog_sun_color.to_linear();
state.ubo_data.fog_sun_color_amount[0] = linear_sun.r;
@@ -4083,7 +4083,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
state.ubo_data.screen_pixel_size[1] = 1.0 / storage->frame.current_rt->height;
}
- _setup_environment(env, p_cam_projection, p_cam_transform);
+ _setup_environment(env, p_cam_projection, p_cam_transform, p_reflection_probe.is_valid());
bool fb_cleared = false;