threejs立方體貼圖產生邊緣鋸齒問題


threejs立方體貼圖產生邊緣鋸齒問題

立方體貼圖邊緣鋸齒                                                                                

 解決后

經過試驗測試發現,

textureGrass.wrapS和 textureGrass.wrapT屬性導致的。

解決方法1:

刪掉textureGrass.wrapS和 textureGrass.wrap

var textureGrass = new THREE.ImageUtils.loadTexture(src);
   // 此屬性會產生抗鋸齒
   // 寫法1:刪除即可
   /*textureGrass.wrapS = THREE.RepeatWrapping;
   textureGrass.wrapT = THREE.RepeatWrapping;*/
   // 寫法2:不設置屬性值,等效寫法1
   textureGrass.wrapS;
   textureGrass.wrapT;
   textureGrass.repeat.set(1, 1); //貼圖x,y平鋪數量

 

解決方法2:

屬性值設置為1001

var textureGrass = new THREE.ImageUtils.loadTexture(src);
   // 此屬性會產生抗鋸齒, 屬性值設置為1001即可
   textureGrass.wrapS = 1001;
   textureGrass.wrapT = 1001;
   textureGrass.repeat.set(1, 1); //貼圖x,y平鋪數量

 

 
        

*:THREE.WebGLRenderer83版本實驗

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM