Просмотр исходного кода

Examples: Fix `instancedArray()` usage of `webgpu_compute_birds` (#31230)

* fix `instancedArray()` usage

* Update webgpu_compute_birds.jpg
sunag 10 месяцев назад
Родитель
Сommit
f31ed46939

BIN
examples/screenshots/webgpu_compute_birds.jpg


+ 4 - 4
examples/webgpu_compute_birds.html

@@ -37,7 +37,7 @@
 		<script type="module">
 
 			import * as THREE from 'three';
-			import { uniform, varying, vec4, add, sub, max, dot, sin, mat3, uint, negate, attributeArray, cameraProjectionMatrix, cameraViewMatrix, positionLocal, modelWorldMatrix, sqrt, attribute, property, float, Fn, If, cos, Loop, Continue, normalize, instanceIndex, length } from 'three/tsl';
+			import { uniform, varying, vec4, add, sub, max, dot, sin, mat3, uint, negate, instancedArray, cameraProjectionMatrix, cameraViewMatrix, positionLocal, modelWorldMatrix, sqrt, attribute, property, float, Fn, If, cos, Loop, Continue, normalize, instanceIndex, length } from 'three/tsl';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
@@ -210,9 +210,9 @@
 				// Labels applied to storage nodes and uniform nodes are reflected within the shader output,
 				// and are useful for debugging purposes.
 
-				const positionStorage = attributeArray( positionArray, 'vec3' ).label( 'positionStorage' );
-				const velocityStorage = attributeArray( velocityArray, 'vec3' ).label( 'velocityStorage' );
-				const phaseStorage = attributeArray( phaseArray, 'float' ).label( 'phaseStorage' );
+				const positionStorage = instancedArray( positionArray, 'vec3' ).label( 'positionStorage' );
+				const velocityStorage = instancedArray( velocityArray, 'vec3' ).label( 'velocityStorage' );
+				const phaseStorage = instancedArray( phaseArray, 'float' ).label( 'phaseStorage' );
 
 				// The Pixel Buffer Object (PBO) is required to get the GPU computed data in the WebGL2 fallback.
 

粤ICP备19079148号