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

Updated builds.

上级 685004fb
...@@ -18,9 +18,11 @@ if ( typeof module === 'object' ) { ...@@ -18,9 +18,11 @@ if ( typeof module === 'object' ) {
if ( Math.sign === undefined ) { if ( Math.sign === undefined ) {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
Math.sign = function ( x ) { Math.sign = function ( x ) {
return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : 0; return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : +x;
}; };
...@@ -12631,6 +12633,12 @@ THREE.ObjectLoader.prototype = { ...@@ -12631,6 +12633,12 @@ THREE.ObjectLoader.prototype = {
var materials = this.parseMaterials( json.materials, textures ); var materials = this.parseMaterials( json.materials, textures );
var object = this.parseObject( json.object, geometries, materials ); var object = this.parseObject( json.object, geometries, materials );
if ( json.images === undefined || json.images.length === 0 ) {
if ( onLoad !== undefined ) onLoad( object );
}
return object; return object;
}, },
...@@ -12888,10 +12896,6 @@ THREE.ObjectLoader.prototype = { ...@@ -12888,10 +12896,6 @@ THREE.ObjectLoader.prototype = {
} }
} else {
if ( onLoad !== undefined ) onLoad();
} }
return images; return images;
...@@ -13399,6 +13403,8 @@ THREE.Material = function () { ...@@ -13399,6 +13403,8 @@ THREE.Material = function () {
this.depthTest = true; this.depthTest = true;
this.depthWrite = true; this.depthWrite = true;
this.colorWrite = true;
this.polygonOffset = false; this.polygonOffset = false;
this.polygonOffsetFactor = 0; this.polygonOffsetFactor = 0;
this.polygonOffsetUnits = 0; this.polygonOffsetUnits = 0;
...@@ -21128,6 +21134,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -21128,6 +21134,7 @@ THREE.WebGLRenderer = function ( parameters ) {
state.setDepthTest( true ); state.setDepthTest( true );
state.setDepthWrite( true ); state.setDepthWrite( true );
state.setColorWrite( true );
// _gl.finish(); // _gl.finish();
...@@ -22041,6 +22048,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -22041,6 +22048,7 @@ THREE.WebGLRenderer = function ( parameters ) {
state.setDepthTest( material.depthTest ); state.setDepthTest( material.depthTest );
state.setDepthWrite( material.depthWrite ); state.setDepthWrite( material.depthWrite );
state.setColorWrite( material.colorWrite );
state.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); state.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
} }
...@@ -24629,6 +24637,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) { ...@@ -24629,6 +24637,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
var currentDepthTest = null; var currentDepthTest = null;
var currentDepthWrite = null; var currentDepthWrite = null;
var currentColorWrite = null;
var currentDoubleSided = null; var currentDoubleSided = null;
var currentFlipSided = null; var currentFlipSided = null;
...@@ -24790,6 +24800,17 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) { ...@@ -24790,6 +24800,17 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
}; };
this.setColorWrite = function ( colorWrite ) {
if ( currentColorWrite !== colorWrite ) {
gl.colorMask( colorWrite, colorWrite, colorWrite, colorWrite );
currentColorWrite = colorWrite;
}
};
this.setDoubleSided = function ( doubleSided ) { this.setDoubleSided = function ( doubleSided ) {
if ( currentDoubleSided !== doubleSided ) { if ( currentDoubleSided !== doubleSided ) {
...@@ -24882,6 +24903,7 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) { ...@@ -24882,6 +24903,7 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
currentBlending = null; currentBlending = null;
currentDepthTest = null; currentDepthTest = null;
currentDepthWrite = null; currentDepthWrite = null;
currentColorWrite = null;
currentDoubleSided = null; currentDoubleSided = null;
currentFlipSided = null; currentFlipSided = null;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册