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版本實驗