How to use the ImageBitmapLoader function from three

Find comprehensive JavaScript three.ImageBitmapLoader code examples handpicked from public code repositorys.

3
4
5
6
7
8
9
10
11
12
const useImageBitmapLoader = filepath => {
  const [_, forceUpdate] = useState(false)

  useEffect(() => {
    if (!THREE.Cache.get(filepath)) {
      new THREE.ImageBitmapLoader().load(
        filepath,
        () => forceUpdate(i => !i)
      )
    }
fork icon263
star icon0
watch icon1

2181
2182
2183
2184
2185
2186
2187
2188
2189
2190

    this.textureLoader = new THREE.TextureLoader( this.options.manager );

} else {

    this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );

}

this.textureLoader.setCrossOrigin( this.options.crossOrigin );
fork icon2
star icon10
watch icon0

1488
1489
1490
1491
1492
1493
1494
1495
1496

this.nodeNamesUsed = {}; // Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
// expensive work of uploading a texture to the GPU off the main thread.

if (typeof createImageBitmap !== 'undefined' && /Firefox/.test(navigator.userAgent) === false) {
  this.textureLoader = new _three.ImageBitmapLoader(this.options.manager);
} else {
  this.textureLoader = new _three.TextureLoader(this.options.manager);
}
fork icon0
star icon1
watch icon0

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)