提交 79edf22a 编写于 作者: M Mr.doob

r116.1

上级 af09d367
......@@ -18476,10 +18476,11 @@
}
// clean up
// Clean up
gl.detachShader( program, glVertexShader );
gl.detachShader( program, glFragmentShader );
// Crashes in iOS9 and iOS10. #18402
// gl.detachShader( program, glVertexShader );
// gl.detachShader( program, glFragmentShader );
gl.deleteShader( glVertexShader );
gl.deleteShader( glFragmentShader );
......@@ -80,8 +80,8 @@ c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.sh
c.matcapEncoding):"",c.envMapEncoding?Gd("envMapTexelToLinear",c.envMapEncoding):"",c.emissiveMapEncoding?Gd("emissiveMapTexelToLinear",c.emissiveMapEncoding):"",c.lightMapEncoding?Gd("lightMapTexelToLinear",c.lightMapEncoding):"",c.outputEncoding?gk("linearToOutputTexel",c.outputEncoding):"",c.depthPacking?"#define DEPTH_PACKING "+c.depthPacking:"","\n"].filter(Hd).join("\n"));f=f.replace(gg,fg);f=Lh(f,c);f=Mh(f,c);g=g.replace(gg,fg);g=Lh(g,c);g=Mh(g,c);f=f.replace(Ph,hg).replace(Qh,Nh);g=g.replace(Ph,
hg).replace(Qh,Nh);c.isWebGL2&&!c.isRawShaderMaterial&&(k=!1,m=/^\s*#version\s+300\s+es\s*\n/,c.isShaderMaterial&&null!==f.match(m)&&null!==g.match(m)&&(k=!0,f=f.replace(m,""),g=g.replace(m,"")),e="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+e,h=["#version 300 es\n\n#define varying in",k?"":"out highp vec4 pc_fragColor;",k?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+
"\n"+h);g=h+g;f=Ih(d,35633,e+f);g=Ih(d,35632,g);d.attachShader(q,f);d.attachShader(q,g);void 0!==c.index0AttributeName?d.bindAttribLocation(q,0,c.index0AttributeName):!0===c.morphTargets&&d.bindAttribLocation(q,0,"position");d.linkProgram(q);if(a.debug.checkShaderErrors){a=d.getProgramInfoLog(q).trim();k=d.getShaderInfoLog(f).trim();m=d.getShaderInfoLog(g).trim();p=z=!0;if(!1===d.getProgramParameter(q,35714))z=!1,l=Kh(d,f,"vertex"),r=Kh(d,g,"fragment"),console.error("THREE.WebGLProgram: shader error: ",
d.getError(),"35715",d.getProgramParameter(q,35715),"gl.getProgramInfoLog",a,l,r);else if(""!==a)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",a);else if(""===k||""===m)p=!1;p&&(this.diagnostics={runnable:z,programLog:a,vertexShader:{log:k,prefix:e},fragmentShader:{log:m,prefix:h}})}d.detachShader(q,f);d.detachShader(q,g);d.deleteShader(f);d.deleteShader(g);var t;this.getUniforms=function(){void 0===t&&(t=new Gb(d,q));return t};var n;this.getAttributes=function(){if(void 0===n){for(var a=
{},b=d.getProgramParameter(q,35721),c=0;c<b;c++){var e=d.getActiveAttrib(q,c).name;a[e]=d.getAttribLocation(q,e)}n=a}return n};this.destroy=function(){d.deleteProgram(q);this.program=void 0};this.name=c.shaderName;this.id=ok++;this.cacheKey=b;this.usedTimes=1;this.program=q;this.vertexShader=f;this.fragmentShader=g;return this}function pk(a,b,c){function d(a){if(a)a.isTexture?b=a.encoding:a.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),
d.getError(),"35715",d.getProgramParameter(q,35715),"gl.getProgramInfoLog",a,l,r);else if(""!==a)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",a);else if(""===k||""===m)p=!1;p&&(this.diagnostics={runnable:z,programLog:a,vertexShader:{log:k,prefix:e},fragmentShader:{log:m,prefix:h}})}d.deleteShader(f);d.deleteShader(g);var t;this.getUniforms=function(){void 0===t&&(t=new Gb(d,q));return t};var n;this.getAttributes=function(){if(void 0===n){for(var a={},b=d.getProgramParameter(q,35721),
c=0;c<b;c++){var e=d.getActiveAttrib(q,c).name;a[e]=d.getAttribLocation(q,e)}n=a}return n};this.destroy=function(){d.deleteProgram(q);this.program=void 0};this.name=c.shaderName;this.id=ok++;this.cacheKey=b;this.usedTimes=1;this.program=q;this.vertexShader=f;this.fragmentShader=g;return this}function pk(a,b,c){function d(a){if(a)a.isTexture?b=a.encoding:a.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),
b=a.texture.encoding);else var b=3E3;return b}var e=[],f=c.isWebGL2,g=c.logarithmicDepthBuffer,h=c.floatVertexTextures,k=c.precision,m=c.maxVertexUniforms,z=c.vertexTextures,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",
PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},l="precision isWebGL2 supportsVertexTextures outputEncoding instancing map mapEncoding matcap matcapEncoding envMap envMapMode envMapEncoding envMapCubeUV lightMap lightMapEncoding aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap tangentSpaceNormalMap clearcoatMap clearcoatRoughnessMap clearcoatNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors vertexTangents vertexUvs uvsVertexOnly fog useFog fogExp2 flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights numDirLightShadows numPointLightShadows numSpotLightShadows shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering sheen".split(" ");
this.getParameters=function(e,l,u,n,x,w,ha){var q=n.fog;n=e.isMeshStandardMaterial?n.environment:null;n=e.envMap||n;var r=p[e.type];if(ha.isSkinnedMesh){var t=ha.skeleton.bones;if(h)t=1024;else{var F=Math.min(Math.floor((m-20)/4),t.length);F<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+F+"."),t=0):t=F}}else t=0;null!==e.precision&&(k=c.getMaxPrecision(e.precision),k!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",
......
......@@ -18463,10 +18463,11 @@ function WebGLProgram( renderer, cacheKey, parameters ) {
}
// clean up
// Clean up
gl.detachShader( program, glVertexShader );
gl.detachShader( program, glFragmentShader );
// Crashes in iOS9 and iOS10. #18402
// gl.detachShader( program, glVertexShader );
// gl.detachShader( program, glFragmentShader );
gl.deleteShader( glVertexShader );
gl.deleteShader( glFragmentShader );
{
"name": "three",
"version": "0.116.0",
"version": "0.116.1",
"description": "JavaScript 3D library",
"main": "build/three.js",
"module": "build/three.module.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册