|
556 | 556 | const arrow_keys = [ 'ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft' ]; |
557 | 557 |
|
558 | 558 | window.addEventListener( 'pointerdown', ( event ) => { mouse_down = true; }, false); |
559 | | - window.addEventListener( 'pointerup', ( event ) => { mouse_down = false; }, false); |
| 559 | + window.addEventListener( 'pointerup', ( event ) => { mouse_down = false; mouse_wheel = true; }, false); |
560 | 560 | window.addEventListener( 'wheel', ( event ) => { mouse_wheel = true; }, false); |
561 | 561 | window.addEventListener( 'keydown', ( event ) => { |
562 | 562 | if (arrow_keys.some( k => k === event.key ) || event.ctrlKey || event.metaKey || event.shiftKey) { |
|
723 | 723 | bgnd_linear_gradient = true; |
724 | 724 |
|
725 | 725 | let canvas = document.createElement('canvas'); |
726 | | - let context = canvas.getContext("2d"); |
| 726 | + let context = canvas.getContext('2d'); |
727 | 727 | canvas.width = ww; |
728 | 728 | canvas.height = wh; |
729 | 729 |
|
|
737 | 737 |
|
738 | 738 | let texture = new THREE.Texture( canvas ); |
739 | 739 | texture.mapping = THREE.EquirectangularReflectionMapping; |
740 | | - scene.background = texture.clone(); |
741 | 740 | texture.needsUpdate = true; |
742 | 741 |
|
| 742 | + scene.background = texture.clone(); |
| 743 | + |
743 | 744 | texture.dispose(); |
744 | 745 |
|
745 | 746 | document.getElementById('file_image_input').value = ''; |
|
1100 | 1101 |
|
1101 | 1102 | if (renderer === undefined) { |
1102 | 1103 | renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } ); |
| 1104 | + renderer.outputColorSpace = THREE.SRGBColorSpace; |
1103 | 1105 | renderer.setPixelRatio( window.devicePixelRatio ); |
1104 | 1106 | renderer.toneMapping = THREE.NeutralToneMapping; |
1105 | 1107 | renderer.toneMappingExposure = 1.0; |
|
1121 | 1123 |
|
1122 | 1124 | if (scene === undefined) scene = new THREE.Scene(); |
1123 | 1125 |
|
1124 | | - scene.backgroundIntensity = 1.155; |
| 1126 | + scene.backgroundIntensity = 1.0; |
1125 | 1127 |
|
1126 | 1128 | if (css_renderer === undefined) { |
1127 | 1129 | css_renderer = new css2d_renderer(); |
|
1628 | 1630 | async function loadPlane() { |
1629 | 1631 | let geometry = new THREE.PlaneGeometry(); |
1630 | 1632 |
|
1631 | | - let material = new THREE.MeshLambertMaterial( { |
| 1633 | + let material = new THREE.MeshStandardMaterial( { |
1632 | 1634 | side: THREE.DoubleSide, |
1633 | 1635 | color: 0xFFFFFF, |
| 1636 | + metalness: 0.8, |
| 1637 | + roughness: 0.5, |
1634 | 1638 | opacity: 1, |
1635 | 1639 | transparent: true |
1636 | 1640 | } ); |
|
2866 | 2870 | texture_files[ current_texture ].tex.colorSpace = THREE.SRGBColorSpace; |
2867 | 2871 | texture_files[ current_texture ].tex.wrapS = THREE.RepeatWrapping; |
2868 | 2872 | texture_files[ current_texture ].tex.wrapT = THREE.RepeatWrapping; |
2869 | | - texture_files[ current_texture ].tex.minFilter = THREE.NearestMipmapNearestFilter; |
2870 | | - texture_files[ current_texture ].tex.maxFilter = THREE.NearestMipmapNearestFilter; |
2871 | 2873 |
|
2872 | 2874 | if (texture_files[ current_texture ].tex.image.length > 0 && !texture_files[ current_texture ].tex.mipmaps) { |
2873 | 2875 | texture_files[ current_texture ].tex.mipmaps = texture_files[ current_texture ].tex.image[ 0 ].mipmaps; |
|
2887 | 2889 | texture_files[ current_texture ].tex.colorSpace = THREE.SRGBColorSpace; |
2888 | 2890 | texture_files[ current_texture ].tex.wrapS = THREE.RepeatWrapping; |
2889 | 2891 | texture_files[ current_texture ].tex.wrapT = THREE.RepeatWrapping; |
2890 | | - texture_files[ current_texture ].tex.minFilter = THREE.NearestMipmapNearestFilter; |
2891 | | - texture_files[ current_texture ].tex.maxFilter = THREE.NearestMipmapNearestFilter; |
2892 | 2892 |
|
2893 | 2893 | if (texture_files[ current_texture ].image && texture_files[ current_texture ].image.length > 0 && !texture_files[ current_texture ].mipmaps) { |
2894 | 2894 | texture_files[ current_texture ].mipmaps = texture_files[ current_texture ].image[ 0 ].mipmaps; |
|
3053 | 3053 | } |
3054 | 3054 |
|
3055 | 3055 | if (mouse_wheel === true) { |
3056 | | - if (count > 30) { |
| 3056 | + if (count > 40) { |
3057 | 3057 | mouse_wheel = false; |
3058 | 3058 | count = 0; |
3059 | 3059 | } else { |
|
0 commit comments