Explorar el Código

Improved clearcoat normalmap example.

Mr.doob hace 6 años
padre
commit
fac917f01c

+ 1 - 0
examples/textures/pbr/Scratched_gold/Scratched_gold.txt

@@ -0,0 +1 @@
+https://www.cgbookcase.com/textures/scratched-gold-01

BIN
examples/textures/pbr/Scratched_gold/Scratched_gold_01_1K_AO.png


BIN
examples/textures/pbr/Scratched_gold/Scratched_gold_01_1K_Base_Color.png


BIN
examples/textures/pbr/Scratched_gold/Scratched_gold_01_1K_Height.png


BIN
examples/textures/pbr/Scratched_gold/Scratched_gold_01_1K_Normal.png


BIN
examples/textures/pbr/Scratched_gold/Scratched_gold_01_1K_Roughness.png


+ 13 - 8
examples/webgl_materials_clearcoat_normalmap.html

@@ -85,9 +85,9 @@
 						normalMap.wrapS = THREE.RepeatWrapping;
 						normalMap.wrapS = THREE.RepeatWrapping;
 						normalMap.wrapT = THREE.RepeatWrapping;
 						normalMap.wrapT = THREE.RepeatWrapping;
 
 
-						var clearCoatNormaMap = textureLoader.load( "textures/waternormals.jpg" );
-						clearCoatNormaMap.wrapS = THREE.RepeatWrapping;
-						clearCoatNormaMap.wrapT = THREE.RepeatWrapping;
+						var normalMap2 = textureLoader.load( "textures/water/Water_1_M_Normal.jpg" );
+
+						var clearCoatNormaMap = textureLoader.load( "textures/pbr/Scratched_gold/Scratched_gold_01_1K_Normal.png" );
 
 
 						//
 						//
 
 
@@ -119,9 +119,11 @@
 
 
 						var material = new THREE.MeshPhysicalMaterial( {
 						var material = new THREE.MeshPhysicalMaterial( {
 							clearCoat: 1.0,
 							clearCoat: 1.0,
+							metalness: 0.0,
+							color: 0xff0000,
 							envMap: hdrCubeRenderTarget.texture,
 							envMap: hdrCubeRenderTarget.texture,
-							map: diffuse,
-							clearCoatNormalMap: clearCoatNormaMap
+							clearCoatNormalMap: clearCoatNormaMap,
+							clearCoatNormalScale: new THREE.Vector2( 2.0, 2.0 )
 						} );
 						} );
 						var mesh = new THREE.Mesh( geometry, material );
 						var mesh = new THREE.Mesh( geometry, material );
 						mesh.position.x = - 100;
 						mesh.position.x = - 100;
@@ -132,10 +134,13 @@
 
 
 						var material = new THREE.MeshPhysicalMaterial( {
 						var material = new THREE.MeshPhysicalMaterial( {
 							clearCoat: 1.0,
 							clearCoat: 1.0,
+							metalness: 1.0,
+							color: 0xff0000,
 							envMap: hdrCubeRenderTarget.texture,
 							envMap: hdrCubeRenderTarget.texture,
-							map: diffuse,
-							normalMap: normalMap,
-							clearCoatNormalMap: clearCoatNormaMap
+							normalMap: normalMap2,
+							normalScale: new THREE.Vector2( 0.15, 0.15 ),
+							clearCoatNormalMap: clearCoatNormaMap,
+							clearCoatNormalScale: new THREE.Vector2( 2.0, 2.0 )
 						} );
 						} );
 						var mesh = new THREE.Mesh( geometry, material );
 						var mesh = new THREE.Mesh( geometry, material );
 						mesh.position.x = 100;
 						mesh.position.x = 100;