Skip to content

Commit 4de7304

Browse files
committed
fix for safari - uninitialized variables
1 parent c017c17 commit 4de7304

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/graphics/program-lib/chunks/lightSpecularPhong.frag

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ vec3 calcLightSpecular(float tGlossiness, vec3 tReflDirW, vec3 F0, out vec3 tFre
55

66
float rl = max(dot(tReflDirW, -dLightDirNormW), 0.0);
77

8+
tFresnel = vec3(1);
9+
810
// Hack: On Mac OS X, calling pow with zero for the exponent generates hideous artifacts so bias up a little
911
return vec3(pow(rl, specPow + 0.0001));
1012
}

src/graphics/program-lib/programs/standard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,8 @@ var standard = {
12811281
code += chunks.lightDiffuseLambertPS;
12821282

12831283
// used for energy conservation and to modulate specular with half-angle fresnel
1284-
code += "vec3 dLightFresnel;\n";
1285-
code += "vec3 ccLightFresnel;\n\n";
1284+
code += "vec3 dLightFresnel = vec3(0);\n";
1285+
code += "vec3 ccLightFresnel = vec3(0);\n\n";
12861286

12871287
if (hasAreaLights) code += chunks.ltc;
12881288
}

0 commit comments

Comments
 (0)