Skip to content

Commit 6862a07

Browse files
committed
fix(soba): attempt to use args for instanced buffer attribute
1 parent 1613744 commit 6862a07

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

libs/core/project.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
"parallel": true
5454
}
5555
},
56+
"publish": {
57+
"command": "npm publish",
58+
"cwd": "dist/libs/core"
59+
},
5660
"test": {
5761
"executor": "@nx/jest:jest",
5862
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],

libs/soba/performances/src/instances/instances.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,19 @@ export class NgtsInstance {
103103
standalone: true,
104104
template: `
105105
<ngt-instanced-mesh
106+
*args="[undefined, undefined, 0]"
106107
[userData]="{ instances: meshes() }"
107108
[ref]="instancesRef"
108109
[matrixAutoUpdate]="false"
109110
[raycast]="nullRaycast"
110-
*args="[undefined, undefined, 0]"
111111
ngtCompound
112112
>
113113
<ngt-instanced-buffer-attribute
114+
*args="[matrices(), 16]"
114115
attach="instanceMatrix"
115-
[count]="matrices().length / 16"
116-
[array]="matrices()"
117-
[itemSize]="16"
118-
[usage]="DynamicDrawUsage"
119-
/>
120-
<ngt-instanced-buffer-attribute
121-
attach="instanceColor"
122-
[count]="colors().length / 3"
123-
[array]="colors()"
124-
[itemSize]="3"
125116
[usage]="DynamicDrawUsage"
126117
/>
118+
<ngt-instanced-buffer-attribute *args="[colors(), 3]" attach="instanceColor" [usage]="DynamicDrawUsage" />
127119
<ng-container *ngTemplateOutlet="content" />
128120
</ngt-instanced-mesh>
129121
`,
@@ -205,7 +197,7 @@ export class NgtsInstances {
205197
this.matrices(),
206198
this.colors(),
207199
];
208-
if (frames === Infinity || count < frames) {
200+
if ((frames === Infinity || count < frames) && instancedMesh) {
209201
instancedMesh.updateMatrix();
210202
instancedMesh.updateMatrixWorld();
211203
parentMatrix.copy(instancedMesh.matrixWorld).invert();

0 commit comments

Comments
 (0)