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

Updated builds.

上级 ca84c149
......@@ -13035,6 +13035,10 @@
} );
var default_vertex = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";
var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
/**
* @author alteredq / http://alteredqualia.com/
*
......@@ -13065,8 +13069,8 @@
this.defines = {};
this.uniforms = {};
this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}';
this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}';
this.vertexShader = default_vertex;
this.fragmentShader = default_fragment;
this.linewidth = 1;
......@@ -23139,7 +23143,7 @@
function setupVertexAttributes( material, program, geometry ) {
if ( geometry && geometry.isInstancedBufferGeometry & ! capabilities.isWebGL2 ) {
if ( geometry && geometry.isInstancedBufferGeometry && ! capabilities.isWebGL2 ) {
if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) {
......@@ -188,7 +188,7 @@ function(){return U};this.setViewport=function(a,b,c,d){ha.set(a,M-b-d,c,d);aa.v
arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;O.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){w.removeEventListener("webglcontextlost",d,!1);w.removeEventListener("webglcontextrestored",e,!1);ua.dispose();qa.dispose();Da.dispose();pa.dispose();ja.dispose();wa.stop()};this.renderBufferImmediate=
function(a,b){aa.initAttributes();var c=Da.get(a);a.hasPositions&&!c.position&&(c.position=O.createBuffer());a.hasNormals&&!c.normal&&(c.normal=O.createBuffer());a.hasUvs&&!c.uv&&(c.uv=O.createBuffer());a.hasColors&&!c.color&&(c.color=O.createBuffer());b=b.getAttributes();a.hasPositions&&(O.bindBuffer(34962,c.position),O.bufferData(34962,a.positionArray,35048),aa.enableAttribute(b.position),O.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(O.bindBuffer(34962,c.normal),O.bufferData(34962,
a.normalArray,35048),aa.enableAttribute(b.normal),O.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(O.bindBuffer(34962,c.uv),O.bufferData(34962,a.uvArray,35048),aa.enableAttribute(b.uv),O.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(O.bindBuffer(34962,c.color),O.bufferData(34962,a.colorArray,35048),aa.enableAttribute(b.color),O.vertexAttribPointer(b.color,3,5126,!1,0,0));aa.disableUnusedAttributes();O.drawArrays(4,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,
g){var h=f.isMesh&&0>f.normalMatrix.determinant();aa.setMaterial(e,h);var k=t(a,c,e,f),m=!1;if(b!==d.id||N!==k.id||vd!==(!0===e.wireframe))b=d.id,N=k.id,vd=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(za.update(f,d,e,k),m=!0);h=d.index;var q=d.attributes.position;c=1;!0===e.wireframe&&(h=va.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var p=sa.get(h);a=Ba;a.setIndex(p)}if(m){if(d&&d.isInstancedBufferGeometry&!ya.isWebGL2&&null===ma.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
g){var h=f.isMesh&&0>f.normalMatrix.determinant();aa.setMaterial(e,h);var k=t(a,c,e,f),m=!1;if(b!==d.id||N!==k.id||vd!==(!0===e.wireframe))b=d.id,N=k.id,vd=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(za.update(f,d,e,k),m=!0);h=d.index;var q=d.attributes.position;c=1;!0===e.wireframe&&(h=va.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var p=sa.get(h);a=Ba;a.setIndex(p)}if(m){if(d&&d.isInstancedBufferGeometry&&!ya.isWebGL2&&null===ma.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
else{aa.initAttributes();m=d.attributes;k=k.getAttributes();var l=e.defaultAttributeValues;for(B in k){var r=k[B];if(0<=r){var x=m[B];if(void 0!==x){var u=x.normalized,n=x.itemSize,w=sa.get(x);if(void 0!==w){var v=w.buffer,z=w.type;w=w.bytesPerElement;if(x.isInterleavedBufferAttribute){var y=x.data,I=y.stride;x=x.offset;y&&y.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(r,y.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)):aa.enableAttribute(r);
O.bindBuffer(34962,v);O.vertexAttribPointer(r,n,z,u,I*w,x*w)}else x.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(r,x.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=x.meshPerAttribute*x.count)):aa.enableAttribute(r),O.bindBuffer(34962,v),O.vertexAttribPointer(r,n,z,u,0,0)}}else if(void 0!==l&&(u=l[B],void 0!==u))switch(u.length){case 2:O.vertexAttrib2fv(r,u);break;case 3:O.vertexAttrib3fv(r,u);break;case 4:O.vertexAttrib4fv(r,u);break;default:O.vertexAttrib1fv(r,u)}}}aa.disableUnusedAttributes()}null!==
h&&O.bindBuffer(34963,p.buffer)}p=Infinity;null!==h?p=h.count:void 0!==q&&(p=q.count);h=d.drawRange.start*c;q=null!==g?g.start*c:0;var B=Math.max(h,q);g=Math.max(0,Math.min(p,h+d.drawRange.count*c,q+(null!==g?g.count*c:Infinity))-1-B+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)aa.setLineWidth(e.wireframeLinewidth*(null===R?T:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),aa.setLineWidth(e*
......
......@@ -13029,6 +13029,10 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
} );
var default_vertex = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";
var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
/**
* @author alteredq / http://alteredqualia.com/
*
......@@ -13059,8 +13063,8 @@ function ShaderMaterial( parameters ) {
this.defines = {};
this.uniforms = {};
this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}';
this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}';
this.vertexShader = default_vertex;
this.fragmentShader = default_fragment;
this.linewidth = 1;
......@@ -23133,7 +23137,7 @@ function WebGLRenderer( parameters ) {
function setupVertexAttributes( material, program, geometry ) {
if ( geometry && geometry.isInstancedBufferGeometry & ! capabilities.isWebGL2 ) {
if ( geometry && geometry.isInstancedBufferGeometry && ! capabilities.isWebGL2 ) {
if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册