Skip to content

Commit fac917f

Browse files
committed
Improved clearcoat normalmap example.
1 parent 27b89fa commit fac917f

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.cgbookcase.com/textures/scratched-gold-01
572 KB
Loading
287 KB
Loading
648 KB
Loading
1.11 MB
Loading
583 KB
Loading

examples/webgl_materials_clearcoat_normalmap.html

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
normalMap.wrapS = THREE.RepeatWrapping;
8686
normalMap.wrapT = THREE.RepeatWrapping;
8787

88-
var clearCoatNormaMap = textureLoader.load( "textures/waternormals.jpg" );
89-
clearCoatNormaMap.wrapS = THREE.RepeatWrapping;
90-
clearCoatNormaMap.wrapT = THREE.RepeatWrapping;
88+
var normalMap2 = textureLoader.load( "textures/water/Water_1_M_Normal.jpg" );
89+
90+
var clearCoatNormaMap = textureLoader.load( "textures/pbr/Scratched_gold/Scratched_gold_01_1K_Normal.png" );
9191

9292
//
9393

@@ -119,9 +119,11 @@
119119

120120
var material = new THREE.MeshPhysicalMaterial( {
121121
clearCoat: 1.0,
122+
metalness: 0.0,
123+
color: 0xff0000,
122124
envMap: hdrCubeRenderTarget.texture,
123-
map: diffuse,
124-
clearCoatNormalMap: clearCoatNormaMap
125+
clearCoatNormalMap: clearCoatNormaMap,
126+
clearCoatNormalScale: new THREE.Vector2( 2.0, 2.0 )
125127
} );
126128
var mesh = new THREE.Mesh( geometry, material );
127129
mesh.position.x = - 100;
@@ -132,10 +134,13 @@
132134

133135
var material = new THREE.MeshPhysicalMaterial( {
134136
clearCoat: 1.0,
137+
metalness: 1.0,
138+
color: 0xff0000,
135139
envMap: hdrCubeRenderTarget.texture,
136-
map: diffuse,
137-
normalMap: normalMap,
138-
clearCoatNormalMap: clearCoatNormaMap
140+
normalMap: normalMap2,
141+
normalScale: new THREE.Vector2( 0.15, 0.15 ),
142+
clearCoatNormalMap: clearCoatNormaMap,
143+
clearCoatNormalScale: new THREE.Vector2( 2.0, 2.0 )
139144
} );
140145
var mesh = new THREE.Mesh( geometry, material );
141146
mesh.position.x = 100;

0 commit comments

Comments
 (0)