|
@@ -2769,18 +2769,24 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributePointer >= 0 ) {
|
|
|
|
|
|
if ( attributeItem ) {
|
|
|
+
|
|
|
attributeSize = attributeItem.itemSize;
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
|
|
|
enableAttribute( attributePointer );
|
|
|
_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -2819,18 +2825,24 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributePointer >= 0 ) {
|
|
|
|
|
|
if ( attributeItem ) {
|
|
|
+
|
|
|
attributeSize = attributeItem.itemSize;
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
|
|
|
enableAttribute( attributePointer );
|
|
|
_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -2865,19 +2877,26 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributePointer >= 0 ) {
|
|
|
|
|
|
if ( attributeItem ) {
|
|
|
+
|
|
|
attributeSize = attributeItem.itemSize;
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
|
|
|
enableAttribute( attributePointer );
|
|
|
_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -2905,18 +2924,24 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributePointer >= 0 ) {
|
|
|
|
|
|
if ( attributeItem ) {
|
|
|
+
|
|
|
attributeSize = attributeItem.itemSize;
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
|
|
|
enableAttribute( attributePointer );
|
|
|
_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues && material.defaultAttributeValues[ attributeName ] ) {
|
|
|
+
|
|
|
if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
|
|
|
+
|
|
|
_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -3023,13 +3048,18 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( object.geometry.faces.length && object.geometry.faces[0].vertexColors.length > 0 ||
|
|
|
object.geometry.__webglColorBuffer ) {
|
|
|
+
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglColorBuffer );
|
|
|
enableAttribute( attributes.color );
|
|
|
_gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+
|
|
|
_gl.vertexAttrib3fv( attributes.color, material.defaultAttributeValues.color );
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// normals
|
|
@@ -3057,12 +3087,16 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributes.uv >= 0 ) {
|
|
|
|
|
|
if ( object.geometry.faceVertexUvs[0] ) {
|
|
|
+
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUVBuffer );
|
|
|
enableAttribute( attributes.uv );
|
|
|
_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributes.uv, material.defaultAttributeValues.uv );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -3070,12 +3104,16 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
if ( attributes.uv2 >= 0 ) {
|
|
|
|
|
|
if ( object.geometry.faceVertexUvs[1] ) {
|
|
|
+
|
|
|
_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUV2Buffer );
|
|
|
enableAttribute( attributes.uv2 );
|
|
|
_gl.vertexAttribPointer( attributes.uv2, 2, _gl.FLOAT, false, 0, 0 );
|
|
|
- }
|
|
|
- else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+ } else if ( material.defaultAttributeValues ) {
|
|
|
+
|
|
|
+
|
|
|
_gl.vertexAttrib2fv( attributes.uv2, material.defaultAttributeValues.uv2 );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|