|
40 | 40 | const library = {}; |
41 | 41 | let serialized = false; |
42 | 42 | const textures = { |
43 | | - brick: { url: 'textures/brick_diffuse.jpg' }, |
44 | | - grass: { url: 'textures/terrain/grasslight-big.jpg' }, |
45 | | - grassNormal: { url: 'textures/terrain/grasslight-big-nm.jpg' }, |
46 | | - decalDiffuse: { url: 'textures/decal/decal-diffuse.png' }, |
47 | | - decalNormal: { url: 'textures/decal/decal-normal.jpg' }, |
48 | | - cloud: { url: 'textures/lava/cloud.png' }, |
49 | | - spherical: { url: 'textures/envmap.png' } |
| 43 | + brick: { url: 'textures/brick_diffuse.jpg', encoding: THREE.sRGBEncoding }, |
| 44 | + grass: { url: 'textures/terrain/grasslight-big.jpg', encoding: THREE.sRGBEncoding }, |
| 45 | + grassNormal: { url: 'textures/terrain/grasslight-big-nm.jpg', encoding: THREE.LinearEncoding }, |
| 46 | + decalDiffuse: { url: 'textures/decal/decal-diffuse.png', encoding: THREE.sRGBEncoding }, |
| 47 | + decalNormal: { url: 'textures/decal/decal-normal.jpg', encoding: THREE.LinearEncoding }, |
| 48 | + cloud: { url: 'textures/lava/cloud.png', encoding: THREE.sRGBEncoding }, |
| 49 | + spherical: { url: 'textures/envmap.png', encoding: THREE.sRGBEncoding } |
50 | 50 | }; |
51 | 51 |
|
52 | 52 | const param = { example: new URL( window.location.href ).searchParams.get( 'e' ) || 'mesh-standard' }; |
|
59 | 59 |
|
60 | 60 | texture = textures[ name ].texture = new THREE.TextureLoader().load( textures[ name ].url ); |
61 | 61 | texture.wrapS = texture.wrapT = THREE.RepeatWrapping; |
| 62 | + texture.encoding = textures[ name ].encoding; |
62 | 63 |
|
63 | 64 | library[ texture.uuid ] = texture; |
64 | 65 |
|
|
187 | 188 | 'basic / spherical-reflection': 'spherical-reflection', |
188 | 189 | 'basic / standard': 'standard', |
189 | 190 | 'basic / uv-transform': 'uv-transform', |
190 | | - |
| 191 | + |
191 | 192 | 'adv / bias': 'bias', |
192 | 193 | 'adv / camera-depth': 'camera-depth', |
193 | 194 | 'adv / caustic': 'caustic', |
|
215 | 216 | 'node / normal': 'node-normal', |
216 | 217 | 'node / position': 'node-position', |
217 | 218 | 'node / reflect': 'node-reflect', |
218 | | - |
| 219 | + |
219 | 220 | 'misc / basic-material': 'basic-material', |
220 | 221 | 'misc / custom-attribute': 'custom-attribute', |
221 | 222 | 'misc / firefly': 'firefly', |
|
0 commit comments