How does WebGLRenderer know when a texture is loaded?

At first, before a texture is loaded, WebGLRender will use black for all pixels of a mesh. Eventually, if we have a continuous loop, once the texture image is loaded the renderer begins to use colors from the image.

How does WebGLRenderer update the program at that point? Where’s that piece of code?

There is no program updated. The renderer just uploads the texture data to the GPU when they are fully loaded. This is indicated by an increased version which is triggered by setting Texture.needsUpdate to true.

1 Like