Skip to content

Commit fdf0c2f

Browse files
committed
Merge remote branch 'NINE78/master' into test
2 parents 18f7859 + 778672f commit fdf0c2f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/renderers/WebGLRenderer.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,12 @@ THREE.WebGLRenderer = function ( parameters ) {
698698

699699
for ( a in materials[ m ].attributes ) {
700700

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+
}
702707

703708
if( !attribute.__webglInitialized || attribute.createUniqueBuffers ) {
704709

@@ -2566,7 +2571,8 @@ THREE.WebGLRenderer = function ( parameters ) {
25662571

25672572
// custom attributes
25682573

2569-
/* if ( geometryGroup.__webglCustomAttributes ) {
2574+
// Use the per-geometryGroup custom attribute arrays which are setup in initMeshBuffers
2575+
if ( geometryGroup.__webglCustomAttributes ) {
25702576

25712577
for( a in geometryGroup.__webglCustomAttributes ) {
25722578

@@ -2581,10 +2587,10 @@ THREE.WebGLRenderer = function ( parameters ) {
25812587

25822588
}
25832589

2584-
}*/
2590+
}
25852591

25862592

2587-
if ( material.attributes ) {
2593+
/* if ( material.attributes ) {
25882594
25892595
for( a in material.attributes ) {
25902596
@@ -2603,7 +2609,7 @@ THREE.WebGLRenderer = function ( parameters ) {
26032609
26042610
}
26052611
2606-
}
2612+
}*/
26072613

26082614

26092615

0 commit comments

Comments
 (0)