Skip to content

Commit 8829b97

Browse files
authored
Merge pull request #15945 from takahirox/ImageBitmapLoaderDocument
Add note about ignored texture properties for ImageBitmap to ImageBitmapLoader document
2 parents 67a4386 + 3bf6399 commit 8829b97

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/api/en/loaders/ImageBitmapLoader.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ <h1>[name]</h1>
1616
Unlike [page:FileLoader], [name] does not avoid multiple concurrent requests to the same URL.
1717
</p>
1818

19+
<p>
20+
Note that [page:Texture.flipY] and [page:Texture.premultiplyAlpha] with [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap] are ignored.
21+
[link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap] needs these configuration on bitmap creation
22+
unlike regular images need them on uploading to GPU. You need to set the equivalent options via [page:ImageBitmapLoader.setOptions]
23+
instead. Refer to [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.10 WebGL specification] for the detail.
24+
</p>
25+
1926
<h2>Example</h2>
2027

2128
<p>
@@ -26,6 +33,9 @@ <h2>Example</h2>
2633
// instantiate a loader
2734
var loader = new THREE.ImageBitmapLoader();
2835

36+
// set options if needed
37+
loader.setOptions( { imageOrientation: 'flipY' } );
38+
2939
// load a image resource
3040
loader.load(
3141
// resource URL

docs/api/zh/loaders/ImageBitmapLoader.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ <h1>[name]</h1>
1616
不像[page:FileLoader], [name]无需避免对同一的URL进行多次请求。
1717
</p>
1818

19+
<p>
20+
Note that [page:Texture.flipY] and [page:Texture.premultiplyAlpha] with [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap] are ignored.
21+
[link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap] needs these configuration on bitmap creation
22+
unlike regular images need them on uploading to GPU. You need to set the equivalent options via [page:ImageBitmapLoader.setOptions]
23+
instead. Refer to [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.10 WebGL specification] for the detail.
24+
</p>
25+
1926
<h2>例子</h2>
2027

2128
<p>
@@ -26,6 +33,9 @@ <h2>例子</h2>
2633
// 初始化一个加载器
2734
var loader = new THREE.ImageBitmapLoader();
2835

36+
// set options if needed
37+
loader.setOptions( { imageOrientation: 'flipY' } );
38+
2939
// 加载一个图片资源
3040
loader.load(
3141
// 资源的URL

0 commit comments

Comments
 (0)