Skip to content

Commit 4684e29

Browse files
committed
normal_fragment.glsl: workaround for Adreno/Nexus 5 not supporting vec3 in dFdx/dFdy. Thanks @spite!
1 parent 23d2595 commit 4684e29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderers/shaders/ShaderChunk/normal_fragment.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifdef FLAT_SHADED
22

3-
vec3 fdx = dFdx( vViewPosition );
4-
vec3 fdy = dFdy( vViewPosition );
3+
vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
4+
vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
55
vec3 normal = normalize( cross( fdx, fdy ) );
66

77
#else

0 commit comments

Comments
 (0)