Skip to content
This repository was archived by the owner on Dec 21, 2025. It is now read-only.

Commit d9d51ab

Browse files
Update Texture Viewer
1 parent a4acd42 commit d9d51ab

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

viewers/templates/Texture Viewer.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@
556556
const arrow_keys = [ 'ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft' ];
557557

558558
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);
560560
window.addEventListener( 'wheel', ( event ) => { mouse_wheel = true; }, false);
561561
window.addEventListener( 'keydown', ( event ) => {
562562
if (arrow_keys.some( k => k === event.key ) || event.ctrlKey || event.metaKey || event.shiftKey) {
@@ -723,7 +723,7 @@
723723
bgnd_linear_gradient = true;
724724

725725
let canvas = document.createElement('canvas');
726-
let context = canvas.getContext("2d");
726+
let context = canvas.getContext('2d');
727727
canvas.width = ww;
728728
canvas.height = wh;
729729

@@ -737,9 +737,10 @@
737737

738738
let texture = new THREE.Texture( canvas );
739739
texture.mapping = THREE.EquirectangularReflectionMapping;
740-
scene.background = texture.clone();
741740
texture.needsUpdate = true;
742741

742+
scene.background = texture.clone();
743+
743744
texture.dispose();
744745

745746
document.getElementById('file_image_input').value = '';
@@ -1100,6 +1101,7 @@
11001101

11011102
if (renderer === undefined) {
11021103
renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
1104+
renderer.outputColorSpace = THREE.SRGBColorSpace;
11031105
renderer.setPixelRatio( window.devicePixelRatio );
11041106
renderer.toneMapping = THREE.NeutralToneMapping;
11051107
renderer.toneMappingExposure = 1.0;
@@ -1121,7 +1123,7 @@
11211123

11221124
if (scene === undefined) scene = new THREE.Scene();
11231125

1124-
scene.backgroundIntensity = 1.155;
1126+
scene.backgroundIntensity = 1.0;
11251127

11261128
if (css_renderer === undefined) {
11271129
css_renderer = new css2d_renderer();
@@ -1628,9 +1630,11 @@
16281630
async function loadPlane() {
16291631
let geometry = new THREE.PlaneGeometry();
16301632

1631-
let material = new THREE.MeshLambertMaterial( {
1633+
let material = new THREE.MeshStandardMaterial( {
16321634
side: THREE.DoubleSide,
16331635
color: 0xFFFFFF,
1636+
metalness: 0.8,
1637+
roughness: 0.5,
16341638
opacity: 1,
16351639
transparent: true
16361640
} );
@@ -2866,8 +2870,6 @@
28662870
texture_files[ current_texture ].tex.colorSpace = THREE.SRGBColorSpace;
28672871
texture_files[ current_texture ].tex.wrapS = THREE.RepeatWrapping;
28682872
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;
28712873

28722874
if (texture_files[ current_texture ].tex.image.length > 0 && !texture_files[ current_texture ].tex.mipmaps) {
28732875
texture_files[ current_texture ].tex.mipmaps = texture_files[ current_texture ].tex.image[ 0 ].mipmaps;
@@ -2887,8 +2889,6 @@
28872889
texture_files[ current_texture ].tex.colorSpace = THREE.SRGBColorSpace;
28882890
texture_files[ current_texture ].tex.wrapS = THREE.RepeatWrapping;
28892891
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;
28922892

28932893
if (texture_files[ current_texture ].image && texture_files[ current_texture ].image.length > 0 && !texture_files[ current_texture ].mipmaps) {
28942894
texture_files[ current_texture ].mipmaps = texture_files[ current_texture ].image[ 0 ].mipmaps;
@@ -3053,7 +3053,7 @@
30533053
}
30543054

30553055
if (mouse_wheel === true) {
3056-
if (count > 30) {
3056+
if (count > 40) {
30573057
mouse_wheel = false;
30583058
count = 0;
30593059
} else {

0 commit comments

Comments
 (0)