diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-09-29 17:02:34 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-09-29 17:03:35 -0300 |
commit | 4115e6d1795270dc0012a6328c951e73dfd24c9a (patch) | |
tree | c862be8fee080ca4bb4a6e2c61093ed4c8c35efb /drivers/gles2/shaders | |
parent | c6f09fb97b48903f8d9d8d3b030b3b03d0a87e19 (diff) |
This fixes a bug in refprobe blending, but I have no idea when I fixed it. It just started working all of sudden..
Diffstat (limited to 'drivers/gles2/shaders')
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 11 |
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 |