model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

Support for glTF models with two UV layers

Open GiuseppeGarone opened this issue 3 years ago • 3 comments

Description

I have a GLB model that uses two UV layers to map textures:

  • UV[0] --> Base Color, Normal
  • UV[1] --> Ambient Occlusion, Roughness, Metalness

Ambient Occlusion, Roughness and Metalness are packed into one single texture.

Problem

When I load the model into the viewer, it seems like only the first UV layer is used for all the textures, and this creates incorrect results as the two UV layers are different. Is it possible to use models whose textures are mapped in two UV layers?

GiuseppeGarone avatar Jun 06 '22 13:06 GiuseppeGarone

This is a known issue in three.js that is currently being worked on. Hopefully we'll have proper support for multiple UV channels soon. Currently on the AO map can use the second UV set.

elalish avatar Jun 06 '22 16:06 elalish

@elalish mind linking the relevant three issues here? I found various (like https://github.com/mrdoob/three.js/issues/12608) but none that looked like currently being worked on.

hybridherbst avatar Aug 29 '22 09:08 hybridherbst

I've chatted with @mrdoob about this occasionally, not sure of the current status; perhaps he'll comment.

elalish avatar Aug 29 '22 16:08 elalish

I came across this quick fix for three.js: https://discourse.threejs.org/t/using-multiple-uv-maps-per-model/41973 Maybe can be ported easily.

MTheProgrammer avatar Oct 04 '22 16:10 MTheProgrammer

Nice! I hear official three.js support for multiple UVs is coming soon 🤞

elalish avatar Oct 04 '22 17:10 elalish

any news on this? cannot find any PR or issue on threejs repo

arpu avatar Jan 04 '23 16:01 arpu

Fixed by #4186

elalish avatar Mar 31 '23 22:03 elalish