I load my mipmap datas into a 2D array:
const mipmaps = new Array<THREE.DataTexture>(8);
mipmaps only takes
ImageData (I’m using TypeScript).
setTextureCube I see
var mipmap = mipmaps[ j ];
var mipmapImage = mipmap.image[ i ].image;
I can’t figure out what
mipmap's type is. What kind of data should I put into
I tried this
and it works.
const mipmaps = new Array<THREE.CubeTexture>(8);
// ...load textures
envMapSpecular.mipmaps = mipmaps as any;
There’s no error and I can use
textureCubeLodEXT in shader so I thought it works.
However, I find that my own mipmaps are not really used, the mipmaps rendered are ones generated automatically by ThreeJS or WebGL. What should I do to use my own mipmaps?
There are two things to notice when set mipmaps matually:
texture.generateMipmaps to false;
- Do not put the origin image in mipmaps array, start with the second level.