Jacobian
Jacobian

Reputation: 10872

GLB model in google model-viewer looks very pale

I'm using google model-viewer to visualize 3D models in my application. The problem is that models are looking very pale - no contrasts, no internal shadows - only shadow below the model. This is how I add my model to the page:


   const model = document.createElement("model-viewer");
   model.setAttribute("src", url); //url point to glb model in my files storage
   model.setAttribute("class", "model-component");
   model.setAttribute("shadow-intensity", "1");
   model.setAttribute("ar", "");               
   model.setAttribute("camera-controls", "");
   document.body.appendChild(model);

And this is the result:

enter image description here

I tried to visualize this model in other libraries and they look different - with contrasts and shadows. How can I fix it to make it look more contrast?

Upvotes: 1

Views: 309

Answers (1)

Peter Williams
Peter Williams

Reputation: 1

I had a similar problem. Make sure your script src points to the latest version of model-viewer. Some older versions are not able to use commerce tone mapping. Commerce delivers nicer colour saturation.

At time of writing the latest version is:

src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"

But check here for updates: google model viewer home

This worked for me. Hope it helps.

Upvotes: 0

Related Questions