ToniFF
December 18, 2019, 8:01am
1
Hi,
I load my mipmap datas into a 2D array:
const mipmaps = new Array<THREE.DataTexture[]>(8);
But DataTexture
's mipmaps
only takes ImageData[]
(I’m using TypeScript).
In 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 CubeTexture
's mipmaps
?
ToniFF
December 18, 2019, 8:19am
2
I tried this and it works.
const mipmaps = new Array<THREE.CubeTexture>(8);
// ...load textures
envMapSpecular.mipmaps = mipmaps as any;
ToniFF
December 20, 2019, 10:28am
3
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?
ToniFF
December 20, 2019, 11:52am
4
There are two things to notice when set mipmaps matually:
Set texture.generateMipmaps
to false;
Do not put the origin image in mipmaps array, start with the second level.
2 Likes