#Textures occasionally wont load (CHROME / BRAVE)

13 messages · Page 1 of 1 (latest)

stark mesa
#

See here for example of issue -> https://streamable.com/3jh1md

I wrap a class around the THREE.TextureLoader class so that I can use it with my system with additional variables for processing.

Then I pass the hopefully loaded texture into a shader material to be used as a uniform.

Then I create a mesh with the material using my texture.

I suspect what is happening is that I am trying to pass the texture into my shader without the image actually being downloaded yet, but after viewing examples online (see https://youtube.com/clip/UgkxXajUQhjdF0ibIgF9jgFxrEbjciyuPUfr), there is no difference in how I am loading the textures and how others are doing it and they are not experiencing this issue.

#

I am using import to get the image, that is what planet is in the constructor of uniformspritetextureloader

#

a live demo of the site is here -> roarthreejs.onrender.com
The code in question can be found in devtools -> Source and in the side bar : roargame-threejs/src/Renderer/renderres and the file in textureloader and the file in shadermaterials

stark mesa
#

plz

lone ember
#

load() performs a fetch asynchronously and then applies it to the model.

There doesn't seem to be any issues for me, but if you keep encountering issues,
perhaps it might be worth deferring adding your models via callbacks or using
the await loadAsync() API.

#

It seems to load every time, even with throttling...

stark mesa
#

which browser and device did you try the site on? I notice its not an issue on mobile at all

#

its a frustrating situation, it makes me think it could be a problem with chromium.
also, thank you for taking the time to reply, this has me up the wall trying to debug it

#

what might also be useful is that in my textureloader class i am attempting to modify attributes of the texture, when the bug occurs I get

THREE.WebGLRenderer: Texture marked for update but no image data found.

warning repeatedly

stark mesa
#

additional testing with the TextureLoader callback functions, when the bug occurs, the onLoad function never gets called

#

even if the image has been downloaded locally