I have a (hopefully) quick question regarding texture loading and the
onLoadedObservable. Does this get fired when the texture is finished downloading (as in, an Image object from the network) or does it wait until it is also actually uploaded to the GPU in WebGL and available for use?
Long story short, I’m having an issue with a custom shader material flashing while loading and am trying to narrow down the root cause. Basically, the texture is applied by doing something like this, but it doesn’t seem to set right away:
texture.onLoadedObservable.addOnce((tex) => this.buildMaterial.setTexture("metallicGlossMap", tex));
It’s more obvious with a 1024p texture than a 128p texture, if that matters.
I can’t post a full example unfortunately as the codebase powering this is fairly large.
Using version 4.2.
Thank you in advance for your help!