this is my first question in this page since i dont find people with this error, I hope I explain myself in this question.
Mm having a problem with WebGl textures, I get the next error: Error: WebGL: texImage2D: Conversion requires pixel reformatting.
This happens here:
function initSueloTextures(gl, sueloParametros) {
sueloParametros.textureSuelo = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, sueloParametros.textureSuelo);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
new Uint8Array([0, 0, 255, 255]));
var sueloImage = new Image();
sueloImage.onload = function() { handleTextureLoaded(gl, sueloImage, sueloParametros.textureSuelo); }
sueloImage.src = "resources/marbletexture.png";
}
function handleTextureLoaded(gl, image, texture) {
console.log("handleTextureLoaded, image = " + image);
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA,
gl.UNSIGNED_BYTE, image);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
gl.generateMipmap(gl.TEXTURE_2D);
gl.bindTexture(gl.TEXTURE_2D, null);
}
The error appears in the handleTextureLoaded texImage2D. I think the variables I use are not a problem because I changed them for another global ones I created to test it and the error still appears.
Im using the last version of Firefox.
Thank you for your time.
