Преглед изворни кода

Examples: Add background to `webgpu_pmrem_scene` (#30116)

* Update WGSLNodeBuilder.js

Arrays are not currently taken into account by the wgslTypeLib. However, with the struct extension #29908, arrays will also become important as a type.

* enables the use of samplers in compute shaders

Since textureSampleLevel is usable in compute shaders, this small PR allows sampler to be used in compute shaders for this purpose

* Update webgpu_pmrem_scene.html

add background to environment reflection

* Update webgpu_pmrem_scene.html

* Update webgpu_pmrem_scene.html

* Update webgpu_pmrem_scene.html

* Update WGSLNodeBuilder.js

* Add files via upload
Spiri0 пре 1 година
родитељ
комит
724a8bf987
2 измењених фајлова са 2 додато и 3 уклоњено
  1. BIN
      examples/screenshots/webgpu_pmrem_scene.jpg
  2. 2 3
      examples/webgpu_pmrem_scene.html

BIN
examples/screenshots/webgpu_pmrem_scene.jpg


+ 2 - 3
examples/webgpu_pmrem_scene.html

@@ -58,8 +58,9 @@
 				controls.update();
 
 				//
+				const loader = new THREE.CubeTextureLoader().setPath( './textures/cube/Park3Med/' );
 
-				scene.background = new THREE.Color( 0x006699 );
+				scene.background = await loader.loadAsync( [ 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg' ] );
 
 				let model;
 
@@ -91,8 +92,6 @@
 
 				const sceneRT = new THREE.PMREMGenerator( renderer ).fromScene( scene );
 
-				scene.background = null;
-				scene.backgroundNode = null;
 
 				//
 

粤ICP备19079148号