@@ -831,6 +831,8 @@ THREE.WebGLRenderer = function ( parameters ) {
831
831
832
832
}
833
833
834
+ //
835
+
834
836
var index = geometry . index ;
835
837
var position = geometry . attributes . position ;
836
838
@@ -865,6 +867,8 @@ THREE.WebGLRenderer = function ( parameters ) {
865
867
866
868
}
867
869
870
+ //
871
+
868
872
var dataStart = 0 ;
869
873
var dataCount = Infinity ;
870
874
@@ -996,48 +1000,44 @@ THREE.WebGLRenderer = function ( parameters ) {
996
1000
997
1001
if ( geometryAttribute !== undefined ) {
998
1002
999
- var dataType = _gl . FLOAT ;
1000
- var normalized = geometryAttribute . normalized ;
1003
+ var type = _gl . FLOAT ;
1001
1004
var array = geometryAttribute . array ;
1005
+ var normalized = geometryAttribute . normalized ;
1006
+
1002
1007
if ( array instanceof Float32Array ) {
1003
1008
1004
- dataType = _gl . FLOAT ;
1009
+ type = _gl . FLOAT ;
1005
1010
1006
1011
} else if ( array instanceof Float64Array ) {
1007
1012
1008
1013
console . warn ( "Unsupported data buffer format: Float64Array" ) ;
1009
1014
1010
1015
} else if ( array instanceof Uint16Array ) {
1011
1016
1012
- dataType = _gl . UNSIGNED_SHORT ;
1013
-
1017
+ type = _gl . UNSIGNED_SHORT ;
1018
+
1014
1019
} else if ( array instanceof Int16Array ) {
1015
1020
1016
- dataType = _gl . SHORT ;
1021
+ type = _gl . SHORT ;
1017
1022
1018
1023
} else if ( array instanceof Uint32Array ) {
1019
1024
1020
- dataType = _gl . UNSIGNED_INT ;
1025
+ type = _gl . UNSIGNED_INT ;
1021
1026
1022
1027
} else if ( array instanceof Int32Array ) {
1023
1028
1024
- dataType = _gl . INT ;
1029
+ type = _gl . INT ;
1025
1030
1026
1031
} else if ( array instanceof Int8Array ) {
1027
1032
1028
- dataType = _gl . BYTE ;
1033
+ type = _gl . BYTE ;
1029
1034
1030
1035
} else if ( array instanceof Uint8Array ) {
1031
1036
1032
- dataType = _gl . UNSIGNED_BYTE ;
1033
-
1034
- } else
1035
- {
1036
-
1037
- dataType = _gl . FLOAT ;
1037
+ type = _gl . UNSIGNED_BYTE ;
1038
1038
1039
1039
}
1040
-
1040
+
1041
1041
var size = geometryAttribute . itemSize ;
1042
1042
var buffer = objects . getAttributeBuffer ( geometryAttribute ) ;
1043
1043
@@ -1064,7 +1064,7 @@ THREE.WebGLRenderer = function ( parameters ) {
1064
1064
}
1065
1065
1066
1066
_gl . bindBuffer ( _gl . ARRAY_BUFFER , buffer ) ;
1067
- _gl . vertexAttribPointer ( programAttribute , size , dataType , normalized , stride * data . array . BYTES_PER_ELEMENT , ( startIndex * stride + offset ) * data . array . BYTES_PER_ELEMENT ) ;
1067
+ _gl . vertexAttribPointer ( programAttribute , size , type , normalized , stride * data . array . BYTES_PER_ELEMENT , ( startIndex * stride + offset ) * data . array . BYTES_PER_ELEMENT ) ;
1068
1068
1069
1069
} else {
1070
1070
@@ -1085,7 +1085,7 @@ THREE.WebGLRenderer = function ( parameters ) {
1085
1085
}
1086
1086
1087
1087
_gl . bindBuffer ( _gl . ARRAY_BUFFER , buffer ) ;
1088
- _gl . vertexAttribPointer ( programAttribute , size , dataType , normalized , 0 , startIndex * size * geometryAttribute . array . BYTES_PER_ELEMENT ) ;
1088
+ _gl . vertexAttribPointer ( programAttribute , size , type , normalized , 0 , startIndex * size * geometryAttribute . array . BYTES_PER_ELEMENT ) ;
1089
1089
1090
1090
}
1091
1091
0 commit comments