Is there any way to minimize the lag when loading a new cubemap?
I’ve tried using several methods for example using tasks as I did in this sample:
If you press ‘space’ there you’ll notice that the animation will be stopped for a while.
My suspicion is that this happens when running GPU transcoding since using Basis format it does not happen, however Basis format continues to break colors and gradients so it is not usable.
Is there any chance to calculate the loading on a background thread and continue the animation meanwhile or something like that?
There is little that can be done here. I am trying to think if it is possible to decode the image in an outside thread, but webgl is running in the main thread, so I can only assume it will bring nothing.
So it seems that it decodes each face before creating the cubemap it has sense but I wonder if there is any way to make the cube in Ram before transcoding so you only need to transcode once instead 6 times.
As I said basis files are needed to be loaded and so, and they have no this issue, that’s why I suspect that transcoding is they key.
Anyway is there any other alternative than Basis (it is really a pity about the loss of quality and yellowish colors and dds files are so large) to make it smoother?
Please check them at 100% (including the lossless compression)
Notice the issues on the dark gray bar as well as the yellowish banding effects around the lamp fixture, maybe they are not so noticeable on mobile devices but pretty neat on computers.
They are not related to Babylon but the Basis system itself since compressing png->basis->png has this issue too.
@RaananW@Evgeni_Popov A user on “the other side of the force” guided me to make this:
My suspects were right and decoding took most of the time, it seems that there ImageLoader has the same problem but ImageBitmap can decode it asynchronously, is there any way to make something like that in Babylon?
In the sample, you can press 1 for using the ImageLoader (same issue than using Babylon) 2 for use ImageBitmap, and 3 to reset.
We added this flag for WebGPU because we needed to use ImageBitmap everywhere possible, but to avoid changing the way we handle WebGL we set it to false by default for this engine.
And your cubemap is made with svg? Or are you just challenging (fair enough)?
Though, I believe an svg would not be of such size and the lag would remain minimal, no? Depends of course on what your svg is made of? Can’t help but wondering . May be you could share this use case so we can figure? Meanwhile, have a great day