SMAAPass๋ฅผ ์ฌ์ฉํ ๋ ๊ฒฝ๊ณ ๊ฐ ๊ธฐ๋ก๋ฉ๋๋ค.
THREE.WebGLRenderer: Texture marked for update but image is incomplete
์ด ๊ฒฝ๊ณ ๋ Image.complete
๊ฐ false์ด๊ธฐ ๋๋ฌธ์ ๋ฐ์ํฉ๋๋ค. Image.complete
์ค์ ํ ํ ๋น๋๊ธฐ ์ธ ๊ฒ์ฒ๋ผ ๋ณด์
๋๋ค.
๊ฐ๋ฅํ ๊ฒฝ์ฐ ์ค์ ์ฌ๋ก๋ ํฌํจํ์ญ์์ค. ๋ค์ ํ ํ๋ฆฟ์์ ์์ํ ์ ์์ต๋๋ค.
๋ค๊ฐ ์ณ์. ๊ฐ๋จํ ์์ ์ ๋ค์ ์ฝ๋ ์น์
๊ณผ ๊ฐ์ต๋๋ค. ์ด์์ ์ผ๋ก๋ SMAAPass
์์์ด ์ค ๋ค์ ์์นํฉ๋๋ค.
var self = this;
setTimeout( function () {
// assigning data to HTMLImageElement.src is asynchronous (see #15162)
// using setTimeout() avoids the warning "Texture marked for update but image is incomplete"
self.searchTexture.needsUpdate = true;
self.areaTexture.needsUpdate = true;
}, 0 );
๋ณ๊ฒฝ ์ฌํญ์ผ๋ก PR์ ํ์๊ฒ ์ต๋๊น?
๊ทธ๊ฒ์ ๋์๊ฒ ํดํน์ฒ๋ผ ๋ณด์ ๋๋ค. ๋ณด๋ค ์ผ๋ฐ์ ์ธ ํจํด์ ๊ณ ๋ คํ์ญ์์ค.
var image = new Image();
image.src = dataURL;
var texture = new THREE.Texture( image );
image.onload = function () {
texture.needsUpdate = true;
};
์ฌ์ค, ๊ทธ๊ฒ ๋ ์ข์ต๋๋ค ๐
onload ์ฝ๋ฐฑ์ผ๋ก ๋ณ๊ฒฝํ๊ฒ ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ทธ๊ฒ์ ๋์๊ฒ ํดํน์ฒ๋ผ ๋ณด์ ๋๋ค. ๋ณด๋ค ์ผ๋ฐ์ ์ธ ํจํด์ ๊ณ ๋ คํ์ญ์์ค.