react-three-renderer icon indicating copy to clipboard operation
react-three-renderer copied to clipboard

Images are slow to load as texture; seeking onLoad hook

Open Robinnnnn opened this issue 9 years ago • 3 comments

We are currently creating a mesh and applying images as the texture for that mesh.

The image sizes are quite large, so upon opening the scene we can see the images loading individually. Ideally we would like to wait until all images have loaded before presenting the view to the user, without using a hacky setTimeout. Is there some sort of onLoad trigger for rendered scenes?

Robinnnnn avatar Oct 17 '16 19:10 Robinnnnn

The textures should have the onload attribute[1]. Onload for scenes have not been added yet but I have thought about how to handle pre loading textures and so on...

One thought of mine was to be able to pass already loaded images into textures, for example to load the images first and then use the react three renderer after all of them have loaded. That one shouldn't take too long to implement...

[1] https://github.com/toxicFork/react-three-renderer/wiki/texture#onload

toxicFork avatar Oct 18 '16 00:10 toxicFork

Thank you for the info. Our first strategy was to ensure the images loaded first, but that did not help. Will keep researching!

Robinnnnn avatar Oct 18 '16 00:10 Robinnnnn

To clarify, the last paragraph would be for me to implement as a feature to r3r :) because currently it's not there

On Tue, 18 Oct 2016, 01:39 Robinnnnn, [email protected] wrote:

Thank you for the info. Our first strategy was to ensure the images loaded first, but that did not help. Will keep researching!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/117#issuecomment-254374816, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLWwtHitBk8h3DUDKWLpXZQMTncbNks5q1BVegaJpZM4KZB4C .

toxicFork avatar Oct 18 '16 07:10 toxicFork