|
@@ -645,7 +645,7 @@ k=THREE.WebGLShader(h,h.VERTEX_SHADER,l+k);n=THREE.WebGLShader(h,h.FRAGMENT_SHAD
|
|
|
h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,m);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===m)t=!1;t&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,prefix:l},fragmentShader:{log:m,prefix:d}});h.deleteShader(k);h.deleteShader(n);var v;this.getUniforms=function(){if(void 0===v){for(var a={},b=h.getProgramParameter(x,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(x,c).name,e=h.getUniformLocation(x,d),f=d.lastIndexOf("[0]");
|
|
|
-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}v=a}return v};var D;this.getAttributes=function(){if(void 0===D){for(var a={},b=h.getProgramParameter(x,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(x,c).name;a[d]=h.getAttribLocation(x,d)}D=a}return D};this.destroy=function(){h.deleteProgram(x);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");
|
|
|
return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=x;this.vertexShader=k;this.fragmentShader=n;return this}}();
|
|
|
-THREE.WebGLPrograms=function(a,b){var c=[],d={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},e="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap specularMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals maxDirLights maxPointLights maxSpotLights maxHemiLights maxShadows shadowMapEnabled pointLightShadows shadowMapType shadowMapDebug alphaTest metal doubleSided flipSided".split(" ");this.getParameters=
|
|
|
+THREE.WebGLPrograms=function(a,b){var c=[],d={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},e="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap displacementMap specularMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals maxDirLights maxPointLights maxSpotLights maxHemiLights maxShadows shadowMapEnabled pointLightShadows shadowMapType shadowMapDebug alphaTest metal doubleSided flipSided".split(" ");this.getParameters=
|
|
|
function(c,e,h,l){var k,n,p,m,q,t=d[c.type];k=q=m=p=n=0;for(var s=e.length;k<s;k++){var u=e[k];!1!==u.visible&&(u instanceof THREE.DirectionalLight&&n++,u instanceof THREE.PointLight&&p++,u instanceof THREE.SpotLight&&m++,u instanceof THREE.HemisphereLight&&q++)}for(var u=k=s=0,x=e.length;u<x;u++){var v=e[u];v.castShadow&&((v instanceof THREE.SpotLight||v instanceof THREE.DirectionalLight)&&s++,v instanceof THREE.PointLight&&(s++,k++))}e=s;b.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture?
|
|
|
s=1024:(s=Math.floor((b.maxVertexUniforms-20)/4),void 0!==l&&l instanceof THREE.SkinnedMesh&&(s=Math.min(l.skeleton.bones.length,s),s<l.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+l.skeleton.bones.length+", this GPU supports just "+s+" (try OpenGL instead of ANGLE)")));u=a.getPrecision();null!==c.precision&&(u=b.getMaxPrecision(c.precision),u!==c.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",c.precision,"not supported, using",u,"instead."));return{shaderID:t,
|
|
|
precision:u,supportsVertexTextures:b.vertexTextures,map:!!c.map,envMap:!!c.envMap,envMapMode:c.envMap&&c.envMap.mapping,lightMap:!!c.lightMap,aoMap:!!c.aoMap,emissiveMap:!!c.emissiveMap,bumpMap:!!c.bumpMap,normalMap:!!c.normalMap,displacementMap:!!c.displacementMap,specularMap:!!c.specularMap,alphaMap:!!c.alphaMap,combine:c.combine,vertexColors:c.vertexColors,fog:h,useFog:c.fog,fogExp:h instanceof THREE.FogExp2,flatShading:c.shading===THREE.FlatShading,sizeAttenuation:c.sizeAttenuation,logarithmicDepthBuffer:b.logarithmicDepthBuffer,
|