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

Updated builds.

上级 7f8a2e92
......@@ -22144,62 +22144,29 @@
if ( object.hasNormals ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal );
if ( ! material.isMeshPhongMaterial &&
! material.isMeshStandardMaterial &&
! material.isMeshNormalMaterial &&
material.flatShading === true ) {
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
var array = object.normalArray;
var nx = ( array[ i + 0 ] + array[ i + 3 ] + array[ i + 6 ] ) / 3;
var ny = ( array[ i + 1 ] + array[ i + 4 ] + array[ i + 7 ] ) / 3;
var nz = ( array[ i + 2 ] + array[ i + 5 ] + array[ i + 8 ] ) / 3;
array[ i + 0 ] = nx;
array[ i + 1 ] = ny;
array[ i + 2 ] = nz;
array[ i + 3 ] = nx;
array[ i + 4 ] = ny;
array[ i + 5 ] = nz;
array[ i + 6 ] = nx;
array[ i + 7 ] = ny;
array[ i + 8 ] = nz;
}
}
_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.normal );
_gl.vertexAttribPointer( programAttributes.normal, 3, _gl.FLOAT, false, 0, 0 );
}
if ( object.hasUvs && material.map ) {
if ( object.hasUvs ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv );
_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.uv );
_gl.vertexAttribPointer( programAttributes.uv, 2, _gl.FLOAT, false, 0, 0 );
}
if ( object.hasColors && material.vertexColors !== NoColors ) {
if ( object.hasColors ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color );
_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.color );
_gl.vertexAttribPointer( programAttributes.color, 3, _gl.FLOAT, false, 0, 0 );
}
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -22138,62 +22138,29 @@ function WebGLRenderer( parameters ) {
if ( object.hasNormals ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal );
if ( ! material.isMeshPhongMaterial &&
! material.isMeshStandardMaterial &&
! material.isMeshNormalMaterial &&
material.flatShading === true ) {
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
var array = object.normalArray;
var nx = ( array[ i + 0 ] + array[ i + 3 ] + array[ i + 6 ] ) / 3;
var ny = ( array[ i + 1 ] + array[ i + 4 ] + array[ i + 7 ] ) / 3;
var nz = ( array[ i + 2 ] + array[ i + 5 ] + array[ i + 8 ] ) / 3;
array[ i + 0 ] = nx;
array[ i + 1 ] = ny;
array[ i + 2 ] = nz;
array[ i + 3 ] = nx;
array[ i + 4 ] = ny;
array[ i + 5 ] = nz;
array[ i + 6 ] = nx;
array[ i + 7 ] = ny;
array[ i + 8 ] = nz;
}
}
_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.normal );
_gl.vertexAttribPointer( programAttributes.normal, 3, _gl.FLOAT, false, 0, 0 );
}
if ( object.hasUvs && material.map ) {
if ( object.hasUvs ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv );
_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.uv );
_gl.vertexAttribPointer( programAttributes.uv, 2, _gl.FLOAT, false, 0, 0 );
}
if ( object.hasColors && material.vertexColors !== NoColors ) {
if ( object.hasColors ) {
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color );
_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );
state.enableAttribute( programAttributes.color );
_gl.vertexAttribPointer( programAttributes.color, 3, _gl.FLOAT, false, 0, 0 );
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册