@@ -272,11 +272,7 @@ class ChunkMesher {
272272 if ( mainBlock . boundingBox === 'block' ) {
273273 for ( const side in neighbours ) {
274274 const nBlock = neighbours [ side ]
275- if ( mainBlock . transparent ) {
276- if ( nBlock . boundingBox !== 'block' ) {
277- this . addFace ( tVertexBuffer , VertexBuffer , side , pos )
278- }
279- } else if ( nBlock . boundingBox !== 'block' || nBlock . transparent ) {
275+ if ( ( mainBlock . transparent && nBlock . boundingBox !== 'block' ) || ( nBlock . boundingBox !== 'block' || nBlock . transparent ) ) {
280276 this . addFace ( tVertexBuffer , VertexBuffer , side , pos )
281277 }
282278 }
@@ -290,11 +286,14 @@ class ChunkMesher {
290286 }
291287 }
292288 }
293-
294- VertexBuffer . positions . push ( ...tVertexBuffer . positions )
295- VertexBuffer . normals . push ( ...tVertexBuffer . normals )
296- VertexBuffer . uvs . push ( ...tVertexBuffer . uvs )
297- VertexBuffer . colors . push ( ...tVertexBuffer . colors )
289+ for ( let i = 0 ; i < tVertexBuffer . positions . length ; i ++ ) {
290+ VertexBuffer . positions . push ( tVertexBuffer . positions [ i ] )
291+ VertexBuffer . normals . push ( tVertexBuffer . normals [ i ] )
292+ VertexBuffer . colors . push ( tVertexBuffer . colors [ i ] )
293+ }
294+ for ( let i = 0 ; i < tVertexBuffer . uvs . length ; i ++ ) {
295+ VertexBuffer . uvs . push ( tVertexBuffer . uvs [ i ] )
296+ }
298297 return VertexBuffer
299298 }
300299}
0 commit comments