Browse Source

Examples: Don’t use `property()` for creating variables (#32028)

* Don’t use property() for unassigned variable

* Don’t use property() for unassigned variables

* Revert "Don’t use property() for unassigned variables"

This reverts commit a91f2d4ff00c8ad58527b06fc093973df52ea6d5.
Shota Matsuda 4 months ago
parent
commit
2a0228c066
1 changed files with 4 additions and 4 deletions
  1. 4 4
      examples/webgpu_compute_birds.html

+ 4 - 4
examples/webgpu_compute_birds.html

@@ -35,7 +35,7 @@
 		<script type="module">
 
 			import * as THREE from 'three/webgpu';
-			import { uniform, varying, vec4, add, sub, max, dot, sin, mat3, uint, negate, instancedArray, cameraProjectionMatrix, cameraViewMatrix, positionLocal, modelWorldMatrix, sqrt, property, float, Fn, If, cos, Loop, Continue, normalize, instanceIndex, length, vertexIndex } from 'three/tsl';
+			import { uniform, varying, vec4, add, sub, max, dot, sin, mat3, uint, negate, instancedArray, cameraProjectionMatrix, cameraViewMatrix, positionLocal, modelWorldMatrix, sqrt, float, Fn, If, cos, Loop, Continue, normalize, instanceIndex, length, vertexIndex } from 'three/tsl';
 
 			import { Inspector } from 'three/addons/inspector/Inspector.js';
 
@@ -110,7 +110,7 @@
 			}
 
 			// TODO: Fix example with WebGL backend
-			
+
 			if ( WebGPU.isAvailable() === false ) {
 
 				document.body.appendChild( WebGPU.getErrorMessage() );
@@ -293,7 +293,7 @@
 					// Define consts
 					const PI = float( 3.141592653589793 );
 					const PI_2 = PI.mul( 2.0 );
-					const limit = property( 'float', 'limit' ).assign( SPEED_LIMIT );
+					const limit = float( SPEED_LIMIT ).toVar( 'limit' );
 
 					// Destructure uniforms
 					const { alignment, separation, cohesion, deltaTime, rayOrigin, rayDirection } = effectController;
@@ -337,7 +337,7 @@
 						If( i.equal( birdIndex ), () => {
 
 							Continue();
-			
+
 						} );
 
 						// Cache bird's position and velocity

粤ICP备19079148号