|
281 | 281 |
|
282 | 282 | const hd = ( value.toLowerCase().endsWith( '.exr' ) || value.toLowerCase().endsWith( '.hdr' ) ); |
283 | 283 |
|
284 | | - const texParams = scope.getTextureParams( original_mat[ prop ] ); |
| 284 | + const texParams = scope.getTextureParams( original_mat[ prop ], params ); |
285 | 285 | const map = scope.loadTexture( resolveURL( scope.baseUrl, value ) ); |
286 | 286 |
|
287 | 287 | map.repeat.copy( texParams.scale ); |
|
366 | 366 | setMapForType( 'displacementMap', value, lprop ); |
367 | 367 | break; |
368 | 368 |
|
369 | | - case 'disp_b': |
370 | | - params.displacementBias = parseFloat( value ); |
371 | | - break; |
372 | | - |
373 | | - case 'disp_s': |
374 | | - params.displacementScale = parseFloat( value ); |
375 | | - break; |
376 | | - |
377 | 369 | case 'pli': |
378 | 370 | params.lightMapIntensity = parseFloat( value ); |
379 | 371 | break; |
|
659 | 651 | return this.materials[ materialName ]; |
660 | 652 | } |
661 | 653 |
|
662 | | - getTextureParams( value ) { |
| 654 | + getTextureParams( value, matParams ) { |
663 | 655 | const texParams = { |
664 | 656 | scale: new THREE.Vector2( 1, 1 ), |
665 | 657 | offset: new THREE.Vector2( 0, 0 ), |
|
695 | 687 | items.splice( pos, 2 ); |
696 | 688 | } |
697 | 689 |
|
| 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 | + |
698 | 698 | pos = items.indexOf( '-r' ); |
699 | 699 |
|
700 | 700 | if ( pos >= 0 ) { |
|
2872 | 2872 | // If it might be slow to render initially |
2873 | 2873 | if (first_run === true) { |
2874 | 2874 | fr_count ++; |
2875 | | - if (fr_count > 25) { |
| 2875 | + if (fr_count > 100) { |
2876 | 2876 | mouse_wheel = true; |
2877 | 2877 | first_run = false; |
2878 | 2878 | fr_count = 0; |
2879 | 2879 | count = 0; |
2880 | 2880 | } |
2881 | 2881 | } else { |
2882 | 2882 | if (mouse_wheel === true) { |
2883 | | - if (count > 15) { |
| 2883 | + if (count > 100) { |
2884 | 2884 | mouse_wheel = false; |
2885 | 2885 | count = 0; |
2886 | 2886 | } else { |
|
0 commit comments