I loaded a texture by using Three.TextureLoader() and tried to render it by calling .texSubImage2D. But it emit the error below.
““Uncaught (in promise) TypeError: Failed to execute ‘texSubImage2D’ on ‘WebGLRenderingContext’: No function was found that matched the signature provided.””
I called the function like this
context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, context.RGBA, context.UNSIGNED_BYTE, loadedTexture);
Is the problem from CORS? or WebGL2?