|
|
@@ -29,7 +29,7 @@
|
|
|
{
|
|
|
"imports": {
|
|
|
"three": "../build/three.webgpu.js",
|
|
|
- "three/tsl": "../build/three.webgpu.js",
|
|
|
+ "three/tsl": "../build/three.webgpu.js",
|
|
|
"three/addons/": "./jsm/",
|
|
|
"stats-gl": "https://cdn.jsdelivr.net/npm/stats-gl@2.2.7/dist/main.js"
|
|
|
}
|
|
|
@@ -68,6 +68,7 @@
|
|
|
renderBundle: true,
|
|
|
count: MAX_GEOMETRY_COUNT,
|
|
|
opacity: 1,
|
|
|
+ dynamic: false
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -125,9 +126,6 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
function cleanup() {
|
|
|
|
|
|
if ( group ) {
|
|
|
@@ -154,7 +152,7 @@
|
|
|
|
|
|
function initRegularMesh( count ) {
|
|
|
|
|
|
- group = api.renderBundle ? new THREE.BundleGroup() : new THREE.Group();
|
|
|
+ group = api.renderBundle ? new THREE.BundleGroup() : new THREE.Group();
|
|
|
|
|
|
for ( let i = 0; i < count; i ++ ) {
|
|
|
|
|
|
@@ -251,6 +249,8 @@
|
|
|
|
|
|
} );
|
|
|
|
|
|
+ gui.add( api, 'dynamic' );
|
|
|
+
|
|
|
// listeners
|
|
|
|
|
|
window.addEventListener( 'resize', onWindowResize );
|
|
|
@@ -291,10 +291,7 @@
|
|
|
function animateMeshes() {
|
|
|
|
|
|
const count = api.count / ( api.webgpu ? 1 : 10 );
|
|
|
- const countDynamic = api.dynamic / ( api.webgpu ? 1 : 10 );
|
|
|
-
|
|
|
- const loopNum = Math.min( count, countDynamic );
|
|
|
-
|
|
|
+ const loopNum = api.dynamic ? count : 0;
|
|
|
|
|
|
for ( let i = 0; i < loopNum; i ++ ) {
|
|
|
|
|
|
@@ -311,7 +308,8 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
</body>
|