Michael Herzog 4 месяцев назад
Родитель
Сommit
7ea407af9f
2 измененных файлов с 14 добавлено и 6 удалено
  1. 12 4
      examples/webgpu_compute_particles.html
  2. 2 2
      examples/webgpu_lights_custom.html

+ 12 - 4
examples/webgpu_compute_particles.html

@@ -46,7 +46,7 @@
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 
-			const particleCount = 200_000;
+			const particleCount = 200000;
 
 
 			const gravity = uniform( - .00098 );
 			const gravity = uniform( - .00098 );
 			const bounce = uniform( .8 );
 			const bounce = uniform( .8 );
@@ -231,11 +231,19 @@
 				controls.enableDamping = true;
 				controls.enableDamping = true;
 				controls.minDistance = 5;
 				controls.minDistance = 5;
 				controls.maxDistance = 200;
 				controls.maxDistance = 200;
-				controls.target.set( 0, -8, 0 );
+				controls.target.set( 0, - 8, 0 );
 				controls.update();
 				controls.update();
 
 
-				controls.addEventListener( 'start', () => { isOrbitControlsActive = true; } );
-				controls.addEventListener( 'end', () => { isOrbitControlsActive = false; } );
+				controls.addEventListener( 'start', () => {
+
+					isOrbitControlsActive = true;
+
+				} );
+				controls.addEventListener( 'end', () => {
+
+					isOrbitControlsActive = false;
+
+				} );
 
 
 				controls.touches = {
 				controls.touches = {
 					ONE: null,
 					ONE: null,

+ 2 - 2
examples/webgpu_lights_custom.html

@@ -31,7 +31,7 @@
 
 
 			class CustomLightingModel extends THREE.LightingModel {
 			class CustomLightingModel extends THREE.LightingModel {
 
 
-				direct( { lightColor, reflectedLight }, stack ) {
+				direct( { lightColor, reflectedLight }/*, builder */ ) {
 
 
 					reflectedLight.directDiffuse.addAssign( lightColor );
 					reflectedLight.directDiffuse.addAssign( lightColor );
 
 
@@ -85,7 +85,7 @@
 
 
 				const points = [];
 				const points = [];
 
 
-				for ( let i = 0; i < 500_000; i ++ ) {
+				for ( let i = 0; i < 500000; i ++ ) {
 
 
 					const point = new THREE.Vector3().random().subScalar( 0.5 ).multiplyScalar( 3 );
 					const point = new THREE.Vector3().random().subScalar( 0.5 ).multiplyScalar( 3 );
 					points.push( point );
 					points.push( point );

粤ICP备19079148号