Skip to content

glTF example is broken in IE11 #4432

Closed
benbro opened this Issue Feb 13, 2014 · 9 comments

3 participants

@benbro
benbro commented Feb 13, 2014

glTF shows great results on FF and Chrome but it is broken on IE11.
I'm posting this here so other users won't run into the same problem.
KhronosGroup/glTF#222

The are two problems:
1. ArrayBuffer on IE11 doesn't have the slice method.
2. Mising WebGL features on IE11:

S3TC compressed textures not supported
INVALID_OPERATION: clearStencil: Method not currently supported
@mrdoob
Owner
mrdoob commented Feb 13, 2014

ArrayBuffer on IE11 doesn't have the slice method.

That's probably the only relevant problem.

/ping @tparisi

@mrdoob mrdoob added the Enhancement label Feb 13, 2014
@benbro
benbro commented Feb 13, 2014

Erros on IE11 with a different model.
FF and Chrome are fine.

   THREE.WebGLRenderer 66dev
   THREE.WebGLRenderer: Standard derivatives not supported.
   THREE.WebGLRenderer: S3TC compressed textures not supported.
   WEBGL11095: INVALID_OPERATION: clearStencil: Method not currently supported
   File: three.js, Line: 26498, Column: 3
   Shader compilation errors
(179, 41): Undeclared identifier 'gl_FrontFacing'

   1: precision highp float;
2: precision highp int;
3: 
4: 
5: #define MAX_DIR_LIGHTS 1
6: #define MAX_POINT_LIGHTS 1
7: #define MAX_SPOT_LIGHTS 1
8: #define MAX_HEMI_LIGHTS 0
9: #define MAX_SHADOWS 1
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: #define DOUBLE_SIDED
25: 
26: 
27: 
28: 
29: 
30: uniform mat4 viewMatrix;
31: uniform vec3 cameraPosition;
32: uniform vec3 diffuse;
33: uniform float opacity;
34: uniform vec3 ambient;
35: uniform vec3 emissive;
36: uniform vec3 specular;
37: uniform float shininess;
38: #ifdef USE_COLOR
39: varying vec3 vColor;
40: #endif
41: #if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP )
42: varying vec2 vUv;
43: #endif
44: #ifdef USE_MAP
45: uniform sampler2D map;
46: #endif
47: #ifdef USE_LIGHTMAP
48: varying vec2 vUv2;
49: uniform sampler2D lightMap;
50: #endif
51: #ifdef USE_ENVMAP
52: uniform float reflectivity;
53: uniform samplerCube envMap;
54: uniform float flipEnvMap;
55: uniform int combine;
56: #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
57: uniform bool useRefract;
58: uniform float refractionRatio;
59: #else
60: varying vec3 vReflect;
61: #endif
62: #endif
63: #ifdef USE_FOG
64: uniform vec3 fogColor;
65: #ifdef FOG_EXP2
66: uniform float fogDensity;
67: #else
68: uniform float fogNear;
69: uniform float fogFar;
70: #endif
71: #endif
72: uniform vec3 ambientLightColor;
73: #if MAX_DIR_LIGHTS > 0
74: uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];
75: uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];
76: #endif
77: #if MAX_HEMI_LIGHTS > 0
78: uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];
79: uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];
80: uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];
81: #endif
82: #if MAX_POINT_LIGHTS > 0
83: uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];
84: uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];
85: uniform float pointLightDistance[ MAX_POINT_LIGHTS ];
86: #endif
87: #if MAX_SPOT_LIGHTS > 0
88: uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];
89: uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];
90: uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];
91: uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];
92: uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];
93: uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];
94: #endif
95: #if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )
96: varying vec3 vWorldPosition;
97: #endif
98: #ifdef WRAP_AROUND
99: uniform vec3 wrapRGB;
100: #endif
101: varying vec3 vViewPosition;
102: varying vec3 vNormal;
103: #ifdef USE_SHADOWMAP
104: uniform sampler2D shadowMap[ MAX_SHADOWS ];
105: uniform vec2 shadowMapSize[ MAX_SHADOWS ];
106: uniform float shadowDarkness[ MAX_SHADOWS ];
107: uniform float shadowBias[ MAX_SHADOWS ];
108: varying vec4 vShadowCoord[ MAX_SHADOWS ];
109: float unpackDepth( const in vec4 rgba_depth ) {
110: const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );
111: float depth = dot( rgba_depth, bit_shift );
112: return depth;
113: }
114: #endif
115: #ifdef USE_BUMPMAP
116: uniform sampler2D bumpMap;
117: uniform float bumpScale;
118: vec2 dHdxy_fwd() {
119: vec2 dSTdx = dFdx( vUv );
120: vec2 dSTdy = dFdy( vUv );
121: float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
122: float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
123: float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
124: return vec2( dBx, dBy );
125: }
126: vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {
127: vec3 vSigmaX = dFdx( surf_pos );
128: vec3 vSigmaY = dFdy( surf_pos );
129: vec3 vN = surf_norm;
130: vec3 R1 = cross( vSigmaY, vN );
131: vec3 R2 = cross( vN, vSigmaX );
132: float fDet = dot( vSigmaX, R1 );
133: vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
134: return normalize( abs( fDet ) * surf_norm - vGrad );
135: }
136: #endif
137: #ifdef USE_NORMALMAP
138: uniform sampler2D normalMap;
139: uniform vec2 normalScale;
140: vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {
141: vec3 q0 = dFdx( eye_pos.xyz );
142: vec3 q1 = dFdy( eye_pos.xyz );
143: vec2 st0 = dFdx( vUv.st );
144: vec2 st1 = dFdy( vUv.st );
145: vec3 S = normalize(  q0 * st1.t - q1 * st0.t );
146: vec3 T = normalize( -q0 * st1.s + q1 * st0.s );
147: vec3 N = normalize( surf_norm );
148: vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
149: mapN.xy = normalScale * mapN.xy;
150: mat3 tsn = mat3( S, T, N );
151: return normalize( tsn * mapN );
152: }
153: #endif
154: #ifdef USE_SPECULARMAP
155: uniform sampler2D specularMap;
156: #endif
157: void main() {
158: gl_FragColor = vec4( vec3 ( 1.0 ), opacity );
159: #ifdef USE_MAP
160: vec4 texelColor = texture2D( map, vUv );
161: #ifdef GAMMA_INPUT
162: texelColor.xyz *= texelColor.xyz;
163: #endif
164: gl_FragColor = gl_FragColor * texelColor;
165: #endif
166: #ifdef ALPHATEST
167: if ( gl_FragColor.a < ALPHATEST ) discard;
168: #endif
169: float specularStrength;
170: #ifdef USE_SPECULARMAP
171: vec4 texelSpecular = texture2D( specularMap, vUv );
172: specularStrength = texelSpecular.r;
173: #else
174: specularStrength = 1.0;
175: #endif
176: vec3 normal = normalize( vNormal );
177: vec3 viewPosition = normalize( vViewPosition );
178: #ifdef DOUBLE_SIDED
179: normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );
180: #endif
181: #ifdef USE_NORMALMAP
182: normal = perturbNormal2Arb( -vViewPosition, normal );
183: #elif defined( USE_BUMPMAP )
184: normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );
185: #endif
186: #if MAX_POINT_LIGHTS > 0
187: vec3 pointDiffuse  = vec3( 0.0 );
188: vec3 pointSpecular = vec3( 0.0 );
189: for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
190: vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
191: vec3 lVector = lPosition.xyz + vViewPosition.xyz;
192: float lDistance = 1.0;
193: if ( pointLightDistance[ i ] > 0.0 )
194: lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
195: lVector = normalize( lVector );
196: float dotProduct = dot( normal, lVector );
197: #ifdef WRAP_AROUND
198: float pointDiffuseWeightFull = max( dotProduct, 0.0 );
199: float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );
200: vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );
201: #else
202: float pointDiffuseWeight = max( dotProduct, 0.0 );
203: #endif
204: pointDiffuse  += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;
205: vec3 pointHalfVector = normalize( lVector + viewPosition );
206: float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );
207: float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );
208: float specularNormalization = ( shininess + 2.0001 ) / 8.0;
209: vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, pointHalfVector ), 5.0 );
210: pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;
211: }
212: #endif
213: #if MAX_SPOT_LIGHTS > 0
214: vec3 spotDiffuse  = vec3( 0.0 );
215: vec3 spotSpecular = vec3( 0.0 );
216: for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {
217: vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );
218: vec3 lVector = lPosition.xyz + vViewPosition.xyz;
219: float lDistance = 1.0;
220: if ( spotLightDistance[ i ] > 0.0 )
221: lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );
222: lVector = normalize( lVector );
223: float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );
224: if ( spotEffect > spotLightAngleCos[ i ] ) {
225: spotEffect = max( pow( spotEffect, spotLightExponent[ i ] ), 0.0 );
226: float dotProduct = dot( normal, lVector );
227: #ifdef WRAP_AROUND
228: float spotDiffuseWeightFull = max( dotProduct, 0.0 );
229: float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );
230: vec3 spotDiffuseWeight = mix( vec3 ( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );
231: #else
232: float spotDiffuseWeight = max( dotProduct, 0.0 );
233: #endif
234: spotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;
235: vec3 spotHalfVector = normalize( lVector + viewPosition );
236: float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );
237: float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );
238: float specularNormalization = ( shininess + 2.0001 ) / 8.0;
239: vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, spotHalfVector ), 5.0 );
240: spotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;
241: }
242: }
243: #endif
244: #if MAX_DIR_LIGHTS > 0
245: vec3 dirDiffuse  = vec3( 0.0 );
246: vec3 dirSpecular = vec3( 0.0 );
247: for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {
248: vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );
249: vec3 dirVector = normalize( lDirection.xyz );
250: float dotProduct = dot( normal, dirVector );
251: #ifdef WRAP_AROUND
252: float dirDiffuseWeightFull = max( dotProduct, 0.0 );
253: float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );
254: vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );
255: #else
256: float dirDiffuseWeight = max( dotProduct, 0.0 );
257: #endif
258: dirDiffuse  += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;
259: vec3 dirHalfVector = normalize( dirVector + viewPosition );
260: float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );
261: float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );
262: float specularNormalization = ( shininess + 2.0001 ) / 8.0;
263: vec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );
264: dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;
265: }
266: #endif
267: #if MAX_HEMI_LIGHTS > 0
268: vec3 hemiDiffuse  = vec3( 0.0 );
269: vec3 hemiSpecular = vec3( 0.0 );
270: for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {
271: vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );
272: vec3 lVector = normalize( lDirection.xyz );
273: float dotProduct = dot( normal, lVector );
274: float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;
275: vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );
276: hemiDiffuse += diffuse * hemiColor;
277: vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );
278: float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;
279: float hemiSpecularWeightSky = specularStrength * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );
280: vec3 lVectorGround = -lVector;
281: vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );
282: float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;
283: float hemiSpecularWeightGround = specularStrength * max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );
284: float dotProductGround = dot( normal, lVectorGround );
285: float specularNormalization = ( shininess + 2.0001 ) / 8.0;
286: vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, hemiHalfVectorSky ), 5.0 );
287: vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );
288: hemiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );
289: }
290: #endif
291: vec3 totalDiffuse = vec3( 0.0 );
292: vec3 totalSpecular = vec3( 0.0 );
293: #if MAX_DIR_LIGHTS > 0
294: totalDiffuse += dirDiffuse;
295: totalSpecular += dirSpecular;
296: #endif
297: #if MAX_HEMI_LIGHTS > 0
298: totalDiffuse += hemiDiffuse;
299: totalSpecular += hemiSpecular;
300: #endif
301: #if MAX_POINT_LIGHTS > 0
302: totalDiffuse += pointDiffuse;
303: totalSpecular += pointSpecular;
304: #endif
305: #if MAX_SPOT_LIGHTS > 0
306: totalDiffuse += spotDiffuse;
307: totalSpecular += spotSpecular;
308: #endif
309: #ifdef METAL
310: gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );
311: #else
312: gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;
313: #endif
314: #ifdef USE_LIGHTMAP
315: gl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );
316: #endif
317: #ifdef USE_COLOR
318: gl_FragColor = gl_FragColor * vec4( vColor, 1.0 );
319: #endif
320: #ifdef USE_ENVMAP
321: vec3 reflectVec;
322: #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
323: vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );
324: if ( useRefract ) {
325: reflectVec = refract( cameraToVertex, normal, refractionRatio );
326: } else { 
327: reflectVec = reflect( cameraToVertex, normal );
328: }
329: #else
330: reflectVec = vReflect;
331: #endif
332: #ifdef DOUBLE_SIDED
333: float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );
334: vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
335: #else
336: vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
337: #endif
338: #ifdef GAMMA_INPUT
339: cubeColor.xyz *= cubeColor.xyz;
340: #endif
341: if ( combine == 1 ) {
342: gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );
343: } else if ( combine == 2 ) {
344: gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;
345: } else {
346: gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );
347: }
348: #endif
349: #ifdef USE_SHADOWMAP
350: #ifdef SHADOWMAP_DEBUG
351: vec3 frustumColors[3];
352: frustumColors[0] = vec3( 1.0, 0.5, 0.0 );
353: frustumColors[1] = vec3( 0.0, 1.0, 0.8 );
354: frustumColors[2] = vec3( 0.0, 0.5, 1.0 );
355: #endif
356: #ifdef SHADOWMAP_CASCADE
357: int inFrustumCount = 0;
358: #endif
359: float fDepth;
360: vec3 shadowColor = vec3( 1.0 );
361: for( int i = 0; i < MAX_SHADOWS; i ++ ) {
362: vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;
363: bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
364: bool inFrustum = all( inFrustumVec );
365: #ifdef SHADOWMAP_CASCADE
366: inFrustumCount += int( inFrustum );
367: bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );
368: #else
369: bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
370: #endif
371: bool frustumTest = all( frustumTestVec );
372: if ( frustumTest ) {
373: shadowCoord.z += shadowBias[ i ];
374: #if defined( SHADOWMAP_TYPE_PCF )
375: float shadow = 0.0;
376: const float shadowDelta = 1.0 / 9.0;
377: float xPixelOffset = 1.0 / shadowMapSize[ i ].x;
378: float yPixelOffset = 1.0 / shadowMapSize[ i ].y;
379: float dx0 = -1.25 * xPixelOffset;
380: float dy0 = -1.25 * yPixelOffset;
381: float dx1 = 1.25 * xPixelOffset;
382: float dy1 = 1.25 * yPixelOffset;
383: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );
384: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
385: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );
386: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
387: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );
388: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
389: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );
390: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
391: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );
392: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
393: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );
394: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
395: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );
396: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
397: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );
398: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
399: fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );
400: if ( fDepth < shadowCoord.z ) shadow += shadowDelta;
401: shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );
402: #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
403: float shadow = 0.0;
404: float xPixelOffset = 1.0 / shadowMapSize[ i ].x;
405: float yPixelOffset = 1.0 / shadowMapSize[ i ].y;
406: float dx0 = -1.0 * xPixelOffset;
407: float dy0 = -1.0 * yPixelOffset;
408: float dx1 = 1.0 * xPixelOffset;
409: float dy1 = 1.0 * yPixelOffset;
410: mat3 shadowKernel;
411: mat3 depthKernel;
412: depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );
413: depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );
414: depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );
415: depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );
416: depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );
417: depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );
418: depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );
419: depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );
420: depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );
421: vec3 shadowZ = vec3( shadowCoord.z );
422: shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));
423: shadowKernel[0] *= vec3(0.25);
424: shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));
425: shadowKernel[1] *= vec3(0.25);
426: shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));
427: shadowKernel[2] *= vec3(0.25);
428: vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );
429: shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );
430: shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );
431: vec4 shadowValues;
432: shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );
433: shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );
434: shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );
435: shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );
436: shadow = dot( shadowValues, vec4( 1.0 ) );
437: shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );
438: #else
439: vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );
440: float fDepth = unpackDepth( rgbaDepth );
441: if ( fDepth < shadowCoord.z )
442: shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );
443: #endif
444: }
445: #ifdef SHADOWMAP_DEBUG
446: #ifdef SHADOWMAP_CASCADE
447: if ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];
448: #else
449: if ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];
450: #endif
451: #endif
452: }
453: #ifdef GAMMA_OUTPUT
454: shadowColor *= shadowColor;
455: #endif
456: gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;
457: #endif
458: #ifdef GAMMA_OUTPUT
459: gl_FragColor.xyz = sqrt( gl_FragColor.xyz );
460: #endif
461: #ifdef USE_FOG
462: float depth = gl_FragCoord.z / gl_FragCoord.w;
463: #ifdef FOG_EXP2
464: const float LOG2 = 1.442695;
465: float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );
466: fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );
467: #else
468: float fogFactor = smoothstep( fogNear, fogFar, depth );
469: #endif
470: gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
471: #endif
472: }
   WEBGL11066: INVALID_VALUE: attachShader: WebGLShader object expected
   File: three.js, Line: 25607, Column: 3
   WEBGL11077: INVALID_OPERATION: linkProgram: Fragment shader required
   File: three.js, Line: 25622, Column: 3
   Could not initialise shader
VALIDATE_STATUS: false, gl error [1282]
   Program Info Log: Missing fragment shader

   WEBGL11042: INVALID_OPERATION: getUniformLocation: Program not linked
   File: three.js, Line: 25720, Column: 4
   WEBGL11042: INVALID_OPERATION: getUniformLocation: Program not linked
   WEBGL11042: Too many errors encountered - no more errors will be logged
   File: three.js, Line: 25720, Column: 4
@tparisi
tparisi commented Feb 13, 2014

Ricardo I'll handle this, just not sure when.

@tparisi
tparisi commented Feb 13, 2014

@benbro is that second set of errors also from the glTF demos? If so, which model? Can you attach the test case.

@benbro
benbro commented Feb 13, 2014

If I add a slice shim and comment the doubleSided check, IE11 shows the model
https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/gltf/glTFLoader.js#L731

@benbro
benbro commented Apr 15, 2014

IE11 was updated to 11.0.9600.17041
ArrayBuffer.prototype.slice was added.
gl_FrontFacing is supported.

@benbro benbro closed this Apr 15, 2014
@mrdoob
Owner
mrdoob commented Apr 15, 2014

Yay!

@tparisi
tparisi commented Apr 15, 2014

It's about time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.