Skip to content

Commit

Permalink
Update useTexture/index.ts
Browse files Browse the repository at this point in the history
fiexd TextureLoader use THREE.DefaultLoadingManager as default loading manager 
Tresjs#432
  • Loading branch information
hawk86104 authored Mar 12, 2024
1 parent b04e4aa commit ee8e8f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/composables/useTexture/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Texture } from 'three'
import { LoadingManager, TextureLoader } from 'three'
import type { Texture, LoadingManager } from 'three'
import { TextureLoader } from 'three'
import { isArray } from '../../utils'

export interface PBRMaterialOptions {
Expand Down Expand Up @@ -114,9 +114,10 @@ export async function useTexture<TextureMap extends PBRUseTextureMap>(

export async function useTexture(
paths: readonly [string] | string[] | PBRUseTextureMap,
manager?: LoadingManager
): Promise<Texture | Texture[] | PBRTextureMaps> {
const loadingManager = new LoadingManager()
const textureLoader = new TextureLoader(loadingManager)
// fiexd TextureLoader use THREE.DefaultLoadingManager as default loading manager
const textureLoader = new TextureLoader(manager)

/**
* Load a texture.
Expand Down

0 comments on commit ee8e8f5

Please sign in to comment.