Skip to content
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

is it possibel to use offscreencanvas with nexus+threejs? #135

Open
ua4192 opened this issue Feb 3, 2022 · 5 comments
Open

is it possibel to use offscreencanvas with nexus+threejs? #135

ua4192 opened this issue Feb 3, 2022 · 5 comments

Comments

@ua4192
Copy link

ua4192 commented Feb 3, 2022

Hi Federico.

Is it possible to load a nxz file using offscreencanvas?

Best regards

@ponchio
Copy link
Contributor

ponchio commented Feb 3, 2022

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).

@ua4192
Copy link
Author

ua4192 commented Feb 9, 2022

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.

@ponchio
Copy link
Contributor

ponchio commented Feb 9, 2022

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...

@ua4192
Copy link
Author

ua4192 commented Feb 11, 2022

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

@ponchio
Copy link
Contributor

ponchio commented Feb 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants