Open JackieAnxis opened 2 years ago
For the graph example, when visualizing a graph with more than MAX_TEXTURE_SIZE (it may be 2^14 or 2^15), webGL will report that:
WebGL: INVALID_VALUE: texImage2D: width or height out of range
. Now, the data is bound to texture with one row (newData.width = data.length; newData.height = 1
), when the length of data exceeds the MAX_TEXTURE_SIZE, it will not be visualized. I fold the data into several rows in the texture (newData.width = data.length > MAX_TEXTURE_SIZE ? MAX_TEXTURE_SIZE : data.length; newData.height = Math.ceil(data.length / MAX_TEXTURE_SIZE)
), so that its length will not exceed the MAX_TEXTURE_SIZE.
This PR will fix #8
For the graph example, when visualizing a graph with more than MAX_TEXTURE_SIZE (it may be 2^14 or 2^15), webGL will report that:
WebGL: INVALID_VALUE: texImage2D: width or height out of range
. Now, the data is bound to texture with one row (newData.width = data.length; newData.height = 1
), when the length of data exceeds the MAX_TEXTURE_SIZE, it will not be visualized. I fold the data into several rows in the texture (newData.width = data.length > MAX_TEXTURE_SIZE ? MAX_TEXTURE_SIZE : data.length; newData.height = Math.ceil(data.length / MAX_TEXTURE_SIZE)
), so that its length will not exceed the MAX_TEXTURE_SIZE.