summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gles2/shaders/scene.glsl10
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp2
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 6c3d3baccd..242329d4a7 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -2049,7 +2049,13 @@ FRAGMENT_SHADER_CODE
#if defined(USE_VERTEX_LIGHTING)
+#if defined(BASE_PASS)
gl_FragColor.rgb = mix(gl_FragColor.rgb, fog_interp.rgb, fog_interp.a);
+#else
+ gl_FragColor.rgb *= (1.0 - fog_interp.a);
+#endif // BASE_PASS
+
+
#else //pixel based fog
float fog_amount = 0.0;
@@ -2083,7 +2089,11 @@ FRAGMENT_SHADER_CODE
}
#endif
+#if defined(BASE_PASS)
gl_FragColor.rgb = mix(gl_FragColor.rgb, fog_color, fog_amount);
+#else
+ gl_FragColor.rgb *= (1.0 - fog_amount);
+#endif // BASE_PASS
#endif //use vertex lit
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index b8f0965af8..29b4b0c6c4 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1704,6 +1704,8 @@ void RasterizerCanvasGLES3::canvas_debug_viewport_shadows(Light *p_lights_with_s
light = light->shadows_next_ptr;
}
+
+ canvas_end();
}
void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, CameraMatrix *p_xform_cache) {