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

Commit c16ce1f

Browse files
Update mobile OBJ WebGPU viewer
1 parent fa6e241 commit c16ce1f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

viewers/templates/Mobile/MOBJ WebGPU.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281

282282
const hd = ( value.toLowerCase().endsWith( '.exr' ) || value.toLowerCase().endsWith( '.hdr' ) );
283283

284-
const texParams = scope.getTextureParams( original_mat[ prop ] );
284+
const texParams = scope.getTextureParams( original_mat[ prop ], params );
285285
const map = scope.loadTexture( resolveURL( scope.baseUrl, value ) );
286286

287287
map.repeat.copy( texParams.scale );
@@ -366,14 +366,6 @@
366366
setMapForType( 'displacementMap', value, lprop );
367367
break;
368368

369-
case 'disp_b':
370-
params.displacementBias = parseFloat( value );
371-
break;
372-
373-
case 'disp_s':
374-
params.displacementScale = parseFloat( value );
375-
break;
376-
377369
case 'pli':
378370
params.lightMapIntensity = parseFloat( value );
379371
break;
@@ -659,7 +651,7 @@
659651
return this.materials[ materialName ];
660652
}
661653

662-
getTextureParams( value ) {
654+
getTextureParams( value, matParams ) {
663655
const texParams = {
664656
scale: new THREE.Vector2( 1, 1 ),
665657
offset: new THREE.Vector2( 0, 0 ),
@@ -695,6 +687,14 @@
695687
items.splice( pos, 2 );
696688
}
697689

690+
pos = items.indexOf( '-mm' );
691+
692+
if ( pos >= 0 ) {
693+
matParams.displacementBias = parseFloat( items[ pos + 1 ] );
694+
matParams.displacementScale = parseFloat( items[ pos + 2 ] );
695+
items.splice( pos, 3 );
696+
}
697+
698698
pos = items.indexOf( '-r' );
699699

700700
if ( pos >= 0 ) {
@@ -2872,15 +2872,15 @@
28722872
// If it might be slow to render initially
28732873
if (first_run === true) {
28742874
fr_count ++;
2875-
if (fr_count > 25) {
2875+
if (fr_count > 100) {
28762876
mouse_wheel = true;
28772877
first_run = false;
28782878
fr_count = 0;
28792879
count = 0;
28802880
}
28812881
} else {
28822882
if (mouse_wheel === true) {
2883-
if (count > 15) {
2883+
if (count > 100) {
28842884
mouse_wheel = false;
28852885
count = 0;
28862886
} else {

0 commit comments

Comments
 (0)