google / google/model-viewer

Cannot use ObjectURL for skybox-image

Open
#5,051 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.2k
Forks
947
PR merge metrics
No merged PRs in 30d

Description

Thank you for this fantastic component!

I am using it for a project of mine, [3d-specimen-viewer](https://www.npmjs.com/package/3d-specimen-viewer?activeTab=readme). There, I distribute a 3D file together with original 2D images and HDR files in a ZIP file. This ZIP is then unpacked client-side, which leads to BLOBs, which should then be used with the ``. For the glb/gltf 3D model, it is no problem to use `URL.createObjectURL` and set this resulting object URL as the source for the model. This works.

However, for the HDR/skybox-image, this does not seem to work for some reason; the console logs a warning, `Failure to reconstruct an HDR image from blob:https://cdpn.io/72946529-270c-4202-a1a5-dcd282e24380: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`.

A codepen showing the issue (use the checkbox to toggle the source between the "raw" URL and the object URL) is found here: [https://codepen.io/BernhardWebstudio/pen/dPoZbpp](https://codepen.io/BernhardWebstudio/pen/dPoZbpp)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.