Threejs images occasionally won't load

Hey Brave Support Team!

I am having a bit of trouble with Threejs texture loading. The reason I am posting this here is because I suspect the issue has to do with chromium itself, although I cannot say for certain.

A demonstration of the issue β†’ https://streamable.com/3jh1md

I am using webpack to include .png files for distribution and the import function to include it as a filepath for usage in JS. Threejs has a built in TextureLoader class that creates a JS Image object asynchronously and populates a Texture object with this image once it has been successfully loaded in.

This TextureLoader class has callbacks for the various stages of files being loaded locally, onLoad, onProgress, and onError. These should always be called however, when the bug is present, none of these callbacks get called. To me it seems like there is a silent error.

I have tested this with :

  • Brave Nightly (Version 1.50.23 Chromium: 110.0.5481.77 (Official Build) nightly (arm64))

  • Official release (Version 1.48.158 Chromium: 110.0.5481.77 (Official Build) (arm64))

  • Official release on windows (Version 1.48.158 Chromium 110.0.5481.77 (Official Build) (64-bit))

The bug is present on each.

The mobile versions of Brave and Safari on desktop do not have this issue.

I have also posted this report to Threejs forums as well but thought I would cover all my basis in the slim chance that it is a Chromium issue.

Here are code snippets of my texture loading code and using with Threejs libraries :

Here is my repo β†’ https://github.com/MDouglas345/roargame-threejs
and a live site that can be tested β†’ https://roarthreejs.onrender.com/

You will notice that when the texture is loaded and the planets are rendered, the console will log that the texture is being processed and then loaded, but nothing is logged when the bug is prevalent.

This is the worst kind of issue when its hard to reproduce, but it occurs more often when the Network tab of Dev Tools has a Slow 3G throttle.

Im happy to provide more information if needed!

Thank you,

Porridge

2 Likes

Interesting, I wonder if this is related too https://github.com/brave/brave-browser/issues/28428

Using Brave Nightly, does this match up?

Nightly v1.49.62 (Chromium 109.0.5414.119) OK
Nightly v1.49.64 (Chromium 110.0.5481.52) BAD

2 Likes

Hi, I’m having trouble too with TextureLoader on Brave. Using await loader.loadAsync(url) randomly stuck the script. On the manager itemStart is triggered then nothing else (itemEnd, itemError, onError won’t trigger). Replacing loadAsync(url) by load(url) prevent the script to be stuck, but textures won’t load, displaying black materials when used. My script works fine on Firefox, Chrome and Edge (all browsers updated to their last stable release)

Yes these appear to be related. I tried the Chromium 109.0.54.5414.119 and the issue is not present!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.