mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.08k stars 35.34k forks source link

WebGL: INVALID_VALUE: texImage2D: bad image data #8051

Closed BugGambit closed 8 years ago

BugGambit commented 8 years ago

I am having a problem on the Android's native browser when loading a texture file bigger than 2047x2047 (yes not 2048). When I am loading a 2047x2047 image then three.js resizes the image to 2048x2048 and everything turns out fine, but when I am using a 2048 texture image I get this error message: WebGL: INVALID_VALUE: texImage2D: bad image data and the texture turns out black.

Is there anyway that I can load a 1024 texture, and then update the texture to an 4096 texture if and only if the device supports it?

I am using the newest version of three.js

parth-gudhka commented 8 years ago

@fredrik955 Did you get the solution?

BugGambit commented 8 years ago

@parth-gudhka No, I am sorry. Never figured it out, and I tried to search after a answer on Stackoverflow.

mrdoob commented 8 years ago

@fredrik955 could you create a jsfiddle?

BugGambit commented 8 years ago

@mrdoob I am sorry but the code I used is gone long time ago. I am now using renderer.capabilities.maxTextureSize. But still weird that the texture showed up with three.js's texture resize function, but don't have the code to research it further.