Open ua4192 opened 2 years ago
You mean use the offscreencanvas to load the geometry into the gpu memory? In that case no, it is not possible to share resources between two different webgl contexts (as far as I know).
Hi Federico.
Sorry for my bad explanation. No, my idea is to load a nxz file in a web worker (offscreencanvas) in order not to block my main web thread where the real scene is.
The nxz contains lots of points and the idea is only to transfer an array of ids (gotten from readPixels from the nxz to the main thread). In this way I know which real heavy geometries have to be loaded in the main thread.
It is a kind of occlussion culling computed in the background offscreencanvas web worker.
Best regards and many thanks as always for your support.
I should have implemented occlusion culling long time ago (but it's pretty complicated). Sorry I really have not understood what you are planning, but I don't see any reasons why nxz should not work properly on an offscreencanvas...
Hi Federico.
My idea is to use a point clould based on a nxz file in order to know which trunk geometries (medium sized files based on glb with draco compression --> 200K vertices) I have to load in my real scene. It is just a kind of occlussion culling.
Each point in the nxz file has the information needed to know which files have to be loaded.
Currently I am using a pbo with fence (fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0) in order no to block the main thread but even the readPixel action is async it is impacting in my main thread where the scene is running. This is the reason why I wanted to use a webworker to load the point file and through a tranferable object or a sharedBufferArray send this information to the main thread without any king of impact.
If you want more details I can send you a demo code. The only thing I cannot do is to share the models beacuse my company proxy constraints don't allow me to do it. It is really anoying!! and I know this would make you easier to give me support.
Best regards
Hi, yes, if it's possible I would like to see the code to better understand what you are actually doing. If you prefer we can just have a call and it would be way faster... just write me at ponchio@gmail.com and propose a slot.
Hi Federico.
Is it possible to load a nxz file using offscreencanvas?
Best regards