Skip to content

Commit

Permalink
Adreno 3XX workaround in normalmap_pars_fragment and bumpmap_pars_fra…
Browse files Browse the repository at this point in the history
…gment. See mrdoob#9988
  • Loading branch information
mrdoob authored and amakaroff82 committed May 30, 2017
1 parent 6632132 commit d970ed4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@

vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {

vec3 vSigmaX = dFdx( surf_pos );
vec3 vSigmaY = dFdy( surf_pos );
// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988

vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );
vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );
vec3 vN = surf_norm; // normalized

vec3 R1 = cross( vSigmaY, vN );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {

vec3 q0 = dFdx( eye_pos.xyz );
vec3 q1 = dFdy( eye_pos.xyz );
// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988

vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );
vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );
vec2 st0 = dFdx( vUv.st );
vec2 st1 = dFdy( vUv.st );

Expand Down

0 comments on commit d970ed4

Please sign in to comment.