GLB model is rendered black in model-viewer

I’m using model-viewer component in my app. It is built inside some folder and opened in iframe context. So I just did:

npm install
npm run build

And try to serve the content using my current server. However, when I open the page and try to visualize some model I see no textures. It seems that geometry loaded but it is totally black. You can see the demo here.

What is wrong with that and how can I fix it? I do not want to use model-viewer as a standalone service and with its own endpoint. I want to use it relative to my current application structure.

@slimbuck

Looks like the server is sending the wrong response for the HDR file. Check the contents of
http://84.252.138.255/static/skybox/paul_lobe_haus_2k.hdr.

You probably need to specify a public path when building model-viewer, see here.

When we build model-viewer for our server for playcanvas.com we specify:

BUILD_TYPE=prod PUBLIC_PATH=/model-viewer/static/ npm run build

Hope that helps!

2 Likes

@slimbuck Thank you, Donavan! I guess, README of model-viewer project really needs this information! I’ll check it up!