Przeglądaj źródła

Update documentation for ImageBitmapLoader options (#32574)

James Wheare 3 tygodni temu
rodzic
commit
a66c94ce3e
1 zmienionych plików z 8 dodań i 3 usunięć
  1. 8 3
      src/loaders/ImageBitmapLoader.js

+ 8 - 3
src/loaders/ImageBitmapLoader.js

@@ -10,11 +10,16 @@ const _errorMap = new WeakMap();
  * textures for rendering.
  * textures for rendering.
  *
  *
  * Note that {@link Texture#flipY} and {@link Texture#premultiplyAlpha} are ignored with image bitmaps.
  * Note that {@link Texture#flipY} and {@link Texture#premultiplyAlpha} are ignored with image bitmaps.
- * They needs these configuration on bitmap creation unlike regular images need them on uploading to GPU.
+ * These options need to be configured via {@link ImageBitmapLoader#setOptions} prior to loading,
+ * unlike regular images which can be configured on the Texture to set these options on GPU upload instead.
  *
  *
- * You need to set the equivalent options via {@link ImageBitmapLoader#setOptions} instead.
+ * To match the default behaviour of {@link Texture}, the following options are needed:
  *
  *
- * Also note that unlike {@link FileLoader}, this loader avoids multiple concurrent requests to the same URL only if `Cache` is enabled.
+ * ```js
+ * { imageOrientation: 'flipY', premultiplyAlpha: 'none' }
+ * ```
+ *
+ * Also note that unlike {@link FileLoader}, this loader will only avoid multiple concurrent requests to the same URL if {@link Cache} is enabled.
  *
  *
  * ```js
  * ```js
  * const loader = new THREE.ImageBitmapLoader();
  * const loader = new THREE.ImageBitmapLoader();

粤ICP备19079148号