summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-08-24 13:31:02 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-08-24 13:31:31 -0300
commit62233423c7310a155e8c948c053701dba248dcdb (patch)
tree5c1f20021b1cfb6a0d4c00a4a2d7e22c681c0961 /drivers/gles3
parentc6b340ea98708c27cb5a5a8380ef4072ad2fa839 (diff)
Fix generation of env map, closes #18880
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/shaders/cubemap_filter.glsl10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl
index 1462aacf89..7f2dc5057c 100644
--- a/drivers/gles3/shaders/cubemap_filter.glsl
+++ b/drivers/gles3/shaders/cubemap_filter.glsl
@@ -244,23 +244,23 @@ void main() {
vec3 H = ImportanceSampleGGX(xi, roughness, N);
vec3 V = N;
- vec3 L = normalize(2.0 * dot(V, H) * H - V);
+ vec3 L = (2.0 * dot(V, H) * H - V);
float ndotl = clamp(dot(N, L), 0.0, 1.0);
if (ndotl > 0.0) {
#ifdef USE_SOURCE_PANORAMA
- sum.rgb += texturePanorama(H, source_panorama).rgb * ndotl;
+ sum.rgb += texturePanorama(L, source_panorama).rgb * ndotl;
#endif
#ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
- sum.rgb += textureDualParaboloidArray(H).rgb * ndotl;
+ sum.rgb += textureDualParaboloidArray(L).rgb * ndotl;
#endif
#if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
- H.y = -H.y;
- sum.rgb += textureLod(source_cube, H, 0.0).rgb * ndotl;
+ L.y = -L.y;
+ sum.rgb += textureLod(source_cube, L, 0.0).rgb * ndotl;
#endif
sum.a += ndotl;
}