summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/shaders')
-rw-r--r--drivers/gles2/shaders/scene.glsl11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 468804cc5a..462aff8828 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -755,12 +755,12 @@ void reflection_process(samplerCube reflection_map,
#endif
ambient_out.rgb = textureCubeLod(reflection_map, amb_normal, RADIANCE_MAX_LOD).rgb;
- ambient_out.a = blend;
ambient_out.rgb = mix(ref_ambient.rgb, ambient_out.rgb, ref_ambient.a);
if (exterior) {
ambient_out.rgb = mix(ambient, ambient_out.rgb, blend);
}
+ ambient_out.a = blend;
ambient_out.rgb *= blend;
ambient_accum += ambient_out;
@@ -1357,12 +1357,14 @@ FRAGMENT_SHADER_CODE
ambient_light *= ambient_energy;
+#if defined(USE_REFLECTION_PROBE1) || defined(USE_REFLECTION_PROBE2)
+
-#ifdef USE_REFLECTION_PROBE1
vec4 ambient_accum = vec4(0.0);
vec4 reflection_accum = vec4(0.0);
+#ifdef USE_REFLECTION_PROBE1
reflection_process(reflection_probe1,
#ifdef USE_VERTEX_LIGHTING
@@ -1379,6 +1381,9 @@ FRAGMENT_SHADER_CODE
ambient_light, specular_light, reflection_accum, ambient_accum);
+
+#endif // USE_REFLECTION_PROBE1
+
#ifdef USE_REFLECTION_PROBE2
reflection_process(reflection_probe2,
@@ -1407,7 +1412,7 @@ FRAGMENT_SHADER_CODE
}
#endif
-#endif //use reflection probe 1
+#endif // defined(USE_REFLECTION_PROBE1) || defined(USE_REFLECTION_PROBE2)
#ifdef USE_LIGHTMAP
//ambient light will come entirely from lightmap is lightmap is used