-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider to resize textures for low-end devices #5295
Comments
I want to move this forward because
Additional context: We may be able to think of offloading the resize from the main thread by using |
I'm thinking how to expose the configuration. Some ideas.
I prefer 3, and the default value can be set on mobile devices, for example 512x512. |
Option 3 with a default of 512x512 for mobile sounds like a good idea to me. Some other things to consider:
None of those are blockers though. I think we can benefit from this even if we do the simplest possible implementation, and then iterate on it as needed afterwards. |
I agree with all the comments above, just a couple of questions:
I also agree that server side assets processing would definitely be the ideal solution as:
|
Thanks for the comments.
I think of the both.
Good point. We need to test to check if medias are visible enough even with smaller textures. Ideally I want to resize all the textures.
I'm thinking of all.
Ideally yes. Future work for me.
Maybe. Or we may relax for tablet devices, for example 512x512 for mobile devices and 1024x1024 for tablet devices.
Yes, those should be ones of our future options. But at first I'm thinking of just resizing in the main thread unless significant problems.
Current my impression is, the main thread blocking time caused by texture resize + smaller texture upload is shorter than the one caused by huge texture upload. So we may expect loading time can be shorter. But a concern is, if we resize in the main thread, multiple textures resize will be done sequentially. Multiple (huge) textures upload can be done in parallel in the GPU thread? If so, the blocking time can be longer. Using workers may resolve. We may need to test.
Hm, currently I think all the textures should be resized. I may rethink if any practical use cases.
As I mentioned at another place, I'm thinking of using LOD (only using the lowest level of details for mobiles). And we may be able to create lower of details for mobiles on the fly somewhere, backend, server, or elsewhere.
Maybe. One thing I remember is, when I tried texture compression with WASM on the fly it took a long time like a few minutes. At least texture compression should be done backend. |
In short, I want to start with resizing textures with Because I want to quickly implement texture resizing for a serious iOS problem #4669 The further optimizations are interesting but may add some complexities to our software design/architecture. They should be discussed well. |
This would be a great addition to Hubs and I would suggest broadening the scope beyond mobile. Some sort of LOD analysis would allow you to load textures up to an appropriate resolution and even to vary this dynamically, which could open the possibility of accommodating much larger scenes. It would also dovetail nicely with a progressive loading approach that could speed up room entry. Regarding image resizing: for compressed textures it is strongly encouraged to include all the mipmap levels, and it's the default behaviour for the BasisU tool. This means you will usually have lower resolution versions available and could achieve everything you want by customising the mipmap loading code. The most difficult part of all this is working out what threshold to apply to resolution. Small scenes will be fine at high res, but large scenes may still crash even with a low res cap. Also, the browser gives you very little insight into the amount of memory used or available, so the only real option is to set a budget heuristically. |
I changed my mind. I started to feel like starting with the option 2.
Because
And I may start to with resizing textures only for glTF. I want to think of media (and other) textures later if needed. I want to start to think of further dynamic texture resizing optimizations when we start to think of futher optimizations (Asset proxy server, dynamic LOD creation, Caching, and so on). |
Closing this issue. I had two main purposes with the texture resize.
For 1, #5437 has been merged. For 2, I realized that the visual quality of resized texture is much worse than my expectation. I want to revisit. Maybe optimization on asset creation with LOD and/or compressed textures. They don't have an effect to Sketchfab assets. I want to think of them separately. |
Is your feature request related to a problem? Please describe.
We uses MeshBasicMaterial based material if the material quality mode is low. But we reuse the original textures. If the original textures are huge, they can be slow to be rendered/fetched or consume memory too much on devices on which users want to use low quality mode.
Describe the solution you'd like
Consider to resize huge texture image sizes on the fly, for example to 512x512.
Note: Textures can't be resized if compressed textures?
Describe alternatives you've considered
Introduce LOD support. In low quality mode, we use only low levels. If the assets are created properly, probably low levels should use smaller textures.
The text was updated successfully, but these errors were encountered: