I'm using DataTexture to load Uint8Array Image (download link), here my code:
var map = new THREE.DataTexture( data, 128, 128, THREE.RGBFormat );
map.needsUpdate = true;
material.needsUpdate = true;
material.map = map;
But texture is black and receive these error:
In Firefox:
Error: WebGL: texImage2D: not enough data for operation (need 49152, have 5210)
Error: WebGL: generateMipmap: Level zero of texture is not defined.
In Chrome:
WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not big enough for request
Any advice to get this working?
Thanks.
(I have tried to convert Uint8Array Image to Data64 and load to diffuse map ok, but I don't want to use this way because I'm trying to hide texture from network tab in Chrome F12, using data64 will show the texture...)