File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -698,7 +698,12 @@ THREE.WebGLRenderer = function ( parameters ) {
698
698
699
699
for ( a in materials [ m ] . attributes ) {
700
700
701
- attribute = materials [ m ] . attributes [ a ] ;
701
+ // Do a shallow copy of the attribute object so different geometryGroup chunks use different
702
+ // attribute buffers which are correctly indexed in the setMeshBuffers function
703
+ attribute = { } ;
704
+ for ( prop in materials [ m ] . attributes [ a ] ) {
705
+ attribute [ prop ] = materials [ m ] . attributes [ a ] [ prop ] ;
706
+ }
702
707
703
708
if ( ! attribute . __webglInitialized || attribute . createUniqueBuffers ) {
704
709
@@ -2566,7 +2571,8 @@ THREE.WebGLRenderer = function ( parameters ) {
2566
2571
2567
2572
// custom attributes
2568
2573
2569
- /* if ( geometryGroup.__webglCustomAttributes ) {
2574
+ // Use the per-geometryGroup custom attribute arrays which are setup in initMeshBuffers
2575
+ if ( geometryGroup . __webglCustomAttributes ) {
2570
2576
2571
2577
for ( a in geometryGroup . __webglCustomAttributes ) {
2572
2578
@@ -2581,10 +2587,10 @@ THREE.WebGLRenderer = function ( parameters ) {
2581
2587
2582
2588
}
2583
2589
2584
- }*/
2590
+ }
2585
2591
2586
2592
2587
- if ( material . attributes ) {
2593
+ /* if ( material.attributes ) {
2588
2594
2589
2595
for( a in material.attributes ) {
2590
2596
@@ -2603,7 +2609,7 @@ THREE.WebGLRenderer = function ( parameters ) {
2603
2609
2604
2610
}
2605
2611
2606
- }
2612
+ }*/
2607
2613
2608
2614
2609
2615
You can’t perform that action at this time.
0 commit comments