瀏覽代碼

Update import map versions (#27800)

Garrett Johnson 1 年之前
父節點
當前提交
61be06abbb
共有 3 個文件被更改,包括 15 次插入14 次删除
  1. 1 1
      examples/webgl_geometry_csg.html
  2. 1 1
      examples/webgl_raycaster_bvh.html
  3. 13 12
      examples/webgl_renderer_pathtracer.html

+ 1 - 1
examples/webgl_geometry_csg.html

@@ -29,7 +29,7 @@
 				"imports": {
 					"three": "../build/three.module.js",
 					"three/addons/": "./jsm/",
-					"three-mesh-bvh": "https://unpkg.com/[email protected].0/build/index.module.js",
+					"three-mesh-bvh": "https://unpkg.com/[email protected].3/build/index.module.js",
 					"three-bvh-csg": "https://unpkg.com/[email protected]/build/index.module.js"
 				}
 			}

+ 1 - 1
examples/webgl_raycaster_bvh.html

@@ -29,7 +29,7 @@
 				"imports": {
 					"three": "../build/three.module.js",
 					"three/addons/": "./jsm/",
-					"three-mesh-bvh": "https://unpkg.com/[email protected].0/build/index.module.js"
+					"three-mesh-bvh": "https://unpkg.com/[email protected].3/build/index.module.js"
 				}
 			}
 		</script>

+ 13 - 12
examples/webgl_renderer_pathtracer.html

@@ -44,8 +44,8 @@
 					"three": "../build/three.module.js",
 					"three/addons/": "./jsm/",
 					"three/examples/": "./",
-					"three-gpu-pathtracer": "https://unpkg.com/[email protected].17/build/index.module.js",
-					"three-mesh-bvh": "https://unpkg.com/[email protected].0/build/index.module.js"
+					"three-gpu-pathtracer": "https://unpkg.com/[email protected].20/build/index.module.js",
+					"three-mesh-bvh": "https://unpkg.com/[email protected].3/build/index.module.js"
 				}
 			}
 		</script>
@@ -104,20 +104,21 @@
 				renderer.setClearColor( 0xdddddd );
 				document.body.appendChild( renderer.domElement );
 
-				// initialize the pathtracer
-				pathTracer = new PathTracingRenderer( renderer );
-				pathTracer.alpha = true;
-				pathTracer.tiles.set( params.tiles, params.tiles );
-				pathTracer.material = new PhysicalPathTracingMaterial();
-				pathTracer.material.setDefine( 'FEATURE_MIS', 1 );
-
 				const gradientMap = new GradientEquirectTexture();
 				gradientMap.topColor.set( 0xeeeeee );
 				gradientMap.bottomColor.set( 0xeaeaea );
 				gradientMap.update();
 
-				pathTracer.material.backgroundMap = gradientMap;
+				// initialize the pathtracer
+				pathTracer = new PathTracingRenderer( renderer );
 				pathTracer.camera = camera;
+				pathTracer.alpha = true;
+				pathTracer.tiles.set( params.tiles, params.tiles );
+				pathTracer.material = new PhysicalPathTracingMaterial( {
+					filterGlossyFactor: 0.5,
+					backgroundMap: gradientMap,
+				} );
+				pathTracer.material.setDefine( 'FEATURE_MIS', 1 );
 
 				fsQuad = new FullScreenQuad( new THREE.MeshBasicMaterial( {
 					map: pathTracer.target.texture,
@@ -273,7 +274,7 @@
 
 				// add the model to the scene
 				sceneInfo = result;
-				sceneInfo.scene.traverse( c => {
+				model.traverse( c => {
 
 					if ( c.isLineSegments ) {
 
@@ -282,7 +283,7 @@
 					}
 
 				} );
-				scene.add( sceneInfo.scene );
+				scene.add( model );
 
 				// update the material
 				const { bvh, textures, materials } = result;