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

TypeError: Failed to execute 'createImageBitmap' on 'Window': The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'. #11

Closed
2226174644 opened this issue Nov 30, 2021 · 17 comments

Comments

@2226174644
Copy link

2226174644 commented Nov 30, 2021

When I loaded a 3DTiles with images ,it logged this error.
image
The error is likely from here:
image
image
image
Also,I have tried to load it in Cesium, it works.
Hope for your help.

@2226174644
Copy link
Author

I have sent the 3DTiles to your gmail @Avnerus .Hope it can help solve the problem.

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 1, 2021

Hey there!
Thank you for reporting this and also thank you for your email with the tiles. I will look into them shortly.
In the meantime, could you tell me what you used to create the tileset? Was it tiled on Cesium ION? It looks a bit different than the format I usually worked with. Please also specify any settings that you used to create the tileset. Thank you!
/Avner

@2226174644
Copy link
Author

Thanks for your reply.
For the tileset ,we used our own program to create it .And it wasn't tiled on Cesium ION . It can be loaded in the Cesium without Cesium ION.
image

After tracing the source,I logged the tile in the contentLoader and compared the example 3dtiles with mine in the tiles.content.gltf.image. The Detail info :
image
It looks like the function contentLoader which is in the options of Tileset3D cann't provide the correct 'tile' ?
Is the root of the problem from loaders.gl?

Avnerus added a commit that referenced this issue Dec 2, 2021
@Avnerus
Copy link
Collaborator

Avnerus commented Dec 2, 2021

Hi @2226174644, thanks again for the detailed info.
Are you able to try the current build that's in dev? I pushed a patch which should resolve the problem (has to do with resolving texture paths when they are external to the glTF). However, please use loadersGlGltf: false. In the next release, I am leaning toward removing the hybrid mode of processing glTFs in both loaders.gl and Three.js, as it is getting difficult to maintain.
Let me know if it works!
PS. Are you planning to open-source your custom tiler?
/Avner

@2226174644
Copy link
Author

yeah,I have tried your current build that's in dev and used loadersGlGltf: false. It can load these images and models with without any error. However, the final result is not very good... just like--
image
It's really confusing...Can you load the complete model there?
For open-source,I'm not sure.Because modeling is the work of other colleagues and the tiler is like an earlier versions without some functions, such as KTX2 .I'll let you know if there's any news.

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 3, 2021

Hi, I ran this quickly with debug (debug: true in options, and scene.add(runtime.getTileBoxes()) ),
it seems there is mismatch between the tile's bounding volume and model's transform, something that I haven't yet come across in models tiled by Cesium ION or RealityCapture. If you can see this properly in CesiumJS, could you check how the bounding volumes appear there? It might be there is a difference in how to transformations apply in loaders.gl and CesiumJS.

image

1 similar comment
@Avnerus
Copy link
Collaborator

Avnerus commented Dec 3, 2021

Hi, I ran this quickly with debug (debug: true in options, and scene.add(runtime.getTileBoxes()) ),
it seems there is mismatch between the tile's bounding volume and model's transform, something that I haven't yet come across in models tiled by Cesium ION or RealityCapture. If you can see this properly in CesiumJS, could you check how the bounding volumes appear there? It might be there is a difference in how to transformations apply in loaders.gl and CesiumJS.

image

@2226174644
Copy link
Author

Hi~ I used the options(debug: true) ,it likely has no Tile the you circled in my scene?
image
About the bounding volumes In CesiumJS:
image
Excuse me for giving you so much trouble, thanks.

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 4, 2021

Got it, thank you and no worries!
I suspect there might be a problem in the way the library handles the tile transforms back to three.js, but it is specific to the way the transforms are applied in your custom tileset since the issue does not occur in tilesets from RealityCapture and Cesium ION.
It is anyway in the roadmap to re-visit the transform logic, so hopefully this could be fixed soon.
In the meantime I could ask you to run a few more tests:

  1. Have you tried loading the 3d tiles using deck.gl?
  2. Is it possible that you could reset the transforms/geo-locations in your tiler?

Thanks!

@2226174644
Copy link
Author

Because I've never used deck.gl ,It took me some time to learn it but couldn't load the 3dtiles in the end.I also tried using mapbox-3dtiles to load and log it,it could be loaded without error,but there is nothing at the same latitude and longitude as cesium (sorry...).
And because the 3dtiles are transformed from real scenes,so I can't reset the transforms At this stage.I can gmail another part of the whole data . May it can help you?
PS. According to my colleague, the 3dtiles is handled according to the cesium 3dtiles standard, and no special content is added .The coordinate system of the 3dtiles is the standard ellipsoidal coordinate system of ENU (The ellipsoidal coordinate system of cesium). It used to be mainly used Cesium for UE to Parse. Also it can be parsed by CesiumJS as we can see.

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 6, 2021

@2226174644 Thank you again for the input. I haven't tried the new data yet, but I just pushed some updates, two of which help with the loading of your tileset. It looks now pretty good on my end:
Screenshot from 2021-12-06 16-57-45

Let me know how it works for you.

@2226174644
Copy link
Author

2226174644 commented Dec 7, 2021

Fantastic! It also works very well here with me.
image
Thank you very much again for your help!

By the way,have you ever encountered this problem when running? Although it has no impact on the operation of the program, why does it report such an error?
image

@2226174644
Copy link
Author

2226174644 commented Dec 7, 2021

And I found another issue. if the quantity of child node is more than 2 in the tileset.json(Combination of the first two models),for example:
image
there seems to be something wrong with its texture mapping and boundingVolume.Just like:
Snipaste_2021-12-07_15-53-08
image
I will email the new file which contains the two-part model so that you can have a try. Thanks!

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 8, 2021

Hi @2226174644,
Yes I see there is another issue here. So far I have worked only with tilesets that have just one transformation matrix at the top (root or first child), and then everything under that is in relation to that. I will look into this further and let you know.

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 8, 2021

@2226174644 I have been doing some work with handling tile transforms and tried also to support your case. Could you please try the recent version? Thanks.

@2226174644
Copy link
Author

Excellent! It works very well.Thank you very mush!

@Avnerus
Copy link
Collaborator

Avnerus commented Dec 9, 2021

Great! Regarding math.gl assertion, it occurs when the camera has some invalid data. Might be a race condition when the update occurs before the camera object has all of its properties. I opened a separate issue for that, so I am now closing this one. Thank you for the cooperation and please let us know if you get a chance to open-source some of your work, or are interested to in contributing new features to the loader!

@Avnerus Avnerus closed this as completed Dec 9, 2021
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