Texture mapping for GLB glTF

I’m trying to get a few of Rhino models published on the web using Google Model Viewer and am having trouble with texture mapping for glTF/GLB file formats. @aske was nice enough to write a GLB exporter plug-in for Rhino. It’s a great start but is not equipped for advanced texture mapping at this time.

The texture mapping on these Google Model Viewer examples are extremely detailed and match the level of complexity of the work that I’m trying to publish.

I’ve tried Iris but I don’t know how to get .iris Archives to jive with Google Model Viewer. I’ve explored some of the obj/fbx to GLB converters around the web and they all return terrible results. Where should I go from here? Am I going to need to use something like Blender as a bridge to get these models textured and exported? All further reading, tips, and pointers welcome.

At the moment, there isn’t a great way to get from .3dm to .GLB with PBR materials. It is on our list to do. One current workflow could be to load the .3dm in the Three.js editor. You will probably need to do some additional texturing in the editor. Then from there, you can export to GLB.

There are two fronts we’re currently working towards:

  1. better PBR material support in the 3dmLoader for Threejs
  2. glTF IO in Rhino

Iris exports to the Threejs model format (Google Model Viewer is built on top of threejs), but again, it isn’t fully supporting PBR materials export yet.

2 Likes

Hi Ryan,

I added DracoCompression to my plugin, but didn’t have time to publish it. I’m not 100% sure, but I hope UV’s are basically for free with that. (Yay, for @stevebaer who included DracoCompression in V7!)

PBRs should be more or less free. Just need to drag over the attribs to gltf which directly supports them, if it’s the same PBR shader model.

Then the textures should optionally be linked, or written directly to the glb so it’s 100% self contained. I haven’t checked this out yet.

I might have time during the Christmas holidays to take a stab at it.

1 Like

What do you mean by “free”? Monetarily free or something else?

Thanks for putting some time into this.

What do you mean by “free”? Monetarily free or something else?

Free as in: I don’t need to put a lot of effort into it. Just copy over some values :slight_smile:

copy form where to where? and how? Am I missing an easy way to do this?

For all our web/AR work we need to do a lot of mesh optimization, smoothing, and proper UV unwrapping for all parts. There formats do not have any form of box/projection mapping. You can only see what’s mapped to UV space through unwrapping. You also need that for any kind of shading baking to make things look acceptably good (vertex normal/ambient occlusion/reflection/cavity maps)

hi Luis, it would be great to also see USDZ IO form Rhino. Currently most of our AR work (US/Korea/Japan industrial design clients) is targeted towards iOS users. Mostly because Android stuff still looks horrible without proper PBR support. I read something that BPR is coming to Android too, but not sure when, and of course who knows which devices will support it.

G

1 Like

I meant it’s easy to program copying values from Rhino’s PBR materials to gltf PBR materials. Looks like both can use the Metallic-Roughness model. This won’t be a silver bullet for all use cases of course, but then something basic would work.

DracoCompression from Steve looks like it’s already exporting TEXCOORD_0 (and maybe 1, and 2), which should be enough for most people. Thats the UV map.

I think I’m missing something. I don’t see how compression and just adding a mapping channel can help you in any way to have a PBR material applied. If you get this working and looks decent please let us know!

G

I got textures to work with the MetalRoughness shader. It’s over here if anyone want’s to take it for a spin: glTF-BinExport

3 Likes