Three.js: SMAAPass : ํ…์Šค์ฒ˜๊ฐ€ ์—…๋ฐ์ดํŠธ๋กœ ํ‘œ์‹œ๋˜์—ˆ์ง€๋งŒ ์ด๋ฏธ์ง€๊ฐ€ ๋ถˆ์™„์ „ํ•ฉ๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2018๋…„ 10์›” 29์ผ  ยท  4์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: mrdoob/three.js

๋ฌธ์ œ์— ๋Œ€ํ•œ ์„ค๋ช…

SMAAPass๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ๊ฒฝ๊ณ ๊ฐ€ ๊ธฐ๋ก๋ฉ๋‹ˆ๋‹ค.
THREE.WebGLRenderer: Texture marked for update but image is incomplete
์ด ๊ฒฝ๊ณ ๋Š” Image.complete ๊ฐ€ false์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. Image.complete ์„ค์ • ํ•œ ํ›„ ๋น„๋™๊ธฐ ์ธ ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ž…๋‹ˆ๋‹ค.

๊ฐ€๋Šฅํ•œ ๊ฒฝ์šฐ ์‹ค์ œ ์‚ฌ๋ก€๋„ ํฌํ•จํ•˜์‹ญ์‹œ์˜ค. ๋‹ค์Œ ํ…œํ”Œ๋ฆฟ์—์„œ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Three.js ๋ฒ„์ „
  • [] ๊ฐœ๋ฐœ์ž
  • [x] r97
  • [] ...
๋ธŒ๋ผ์šฐ์ €
  • [x] ๋ชจ๋‘
  • [] ํฌ๋กฌ
  • [] Firefox
  • [ ] ์ธํ„ฐ๋„ท ์ต์Šคํ”Œ๋กœ๋Ÿฌ
OS
  • [x] ๋ชจ๋‘
  • [] Windows
  • [ ] ๋งฅ OS
  • [] Linux
  • [] Android
  • [] iOS
ํ•˜๋“œ์›จ์–ด ์š”๊ตฌ ์‚ฌํ•ญ (๊ทธ๋ž˜ํ”ฝ ์นด๋“œ, VR ์žฅ์น˜ ๋“ฑ)

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๊ทธ๊ฒƒ์€ ๋‚˜์—๊ฒŒ ํ•ดํ‚น์ฒ˜๋Ÿผ ๋ณด์ž…๋‹ˆ๋‹ค. ๋ณด๋‹ค ์ผ๋ฐ˜์ ์ธ ํŒจํ„ด์„ ๊ณ ๋ คํ•˜์‹ญ์‹œ์˜ค.

var image = new Image();
image.src = dataURL;

var texture = new THREE.Texture( image );

image.onload = function () {
    texture.needsUpdate = true;
};

๋ชจ๋“  4 ๋Œ“๊ธ€

๋„ค๊ฐ€ ์˜ณ์•„. ๊ฐ„๋‹จํ•œ ์ˆ˜์ •์€ ๋‹ค์Œ ์ฝ”๋“œ ์„น์…˜๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ด์ƒ์ ์œผ๋กœ๋Š” 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 ์ฝœ๋ฐฑ์œผ๋กœ ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰