Options
All
  • Public
  • Public/Protected
  • All
Menu

A utility for loading Texture resources from a URL.

const loader = new EIGHT.TextureLoader(engine)
loader.loadImageTexture('img/textures/solar-system/2k_earth_daymap.jpg', function(texture) {
  texture.minFilter = EIGHT.TextureMinFilter.NEAREST;
  const geometry = new EIGHT.SphereGeometry(engine, {azimuthSegments: 64, elevationSegments: 32})
  const material = new EIGHT.HTMLScriptsMaterial(engine, ['vs', 'fs'])
  sphere = new EIGHT.Mesh(geometry, material, engine)
  geometry.release()
  material.release()
  sphere.texture = texture
  texture.release()
  scene.add(sphere)
})

Hierarchy

  • TextureLoader

Index

Constructors

constructor

Methods

imageTexture

  • imageTexture(url: string, options?: TextureLoaderOptions): Promise<ImageTexture>

loadImageTexture

  • loadImageTexture(url: string, onLoad: (texture: ImageTexture) => any, onError?: () => any, options?: TextureLoaderOptions): void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Protected property
  • Protected method
  • Static property
  • Static method

Generated using TypeDoc