2014-10-28 2 views
0

SceneLoader로 dds 텍스처를로드하는 데 문제가 있습니다. 현재 three.js의 69 버전을 사용하고 있습니다. THREE.DDSLoader를 사용하도록 SceneLoader를 수정하려고 시도했지만 내 페이지가 멈추고 오류가 발생하지 않습니다.Three.js SceneLoader로 DDS 텍스처로드

수정 : var isCompressed = fullUrl.toLowerCase(). endsWith (".dsds"); // 프로토 타입을 추가해야했습니다. endsWith //console.warn(isCompressed);

  if (isCompressed) { 
       var loader = new THREE.DDSLoader(); 
       console.log(fullUrl); 
       var texture = loader.load(fullUrl);   
      } 
      else{ 

       var loader = THREE.Loader.Handlers.get(fullUrl); 

       if (loader !== null) { 

        texture = loader.load(fullUrl, textureCallback); 

       } else { 

        texture = new THREE.Texture(); 
        loader = new THREE.ImageLoader(); 

        (function (texture) { 

         loader.load(fullUrl, function (image) { 

          texture.image = image; 
          texture.needsUpdate = true; 

          textureCallback(); 

         }); 

        })(texture) 


       } 
      } 

답변

0

신경 쓰지 마라. var texture = loader.load (fullUrl)을 texture = loader.load (fullUrl, textureCallback)로 대체해야했습니다.