glTF export transparent textures

export

#1

@Centaur, first of all thanks for the extension! I’m using it to export 3d posts for Facebook. One problem I’m having though is that when I create a face with a transparent PNG texture, the transparent parts don’t work right. The transparent areas are filled in when I view it on Facebook. Is there anything I can do to fix that, or does the extension need to be updated?


#2

A few other items:

  • How hard would it be to let us adjust the metal-roughness values of individual materials? I’d love to create nice effects and not have to keep everything so flat.

  • I also need to be able to set materials to NOT double-sided; by default it appears you are setting double-sided to true.


#3

I found a comment on Facebook about this subject:
“save your diffuse in .jpg so the file size is a lot smaller than png. In Modo drag and drop the diffuse onto your object. Press M, go to Type and change it to glTF Material. Now go to your Shading tree. Drag the diffuse texture above the glTF Material and change the effect to glTF Base Color. Now just export your object as .gbl and upload it, the diffuse will be embedded.”

My guess is you probably need an extension, but if that doesn’t exist then another program.

Here’s another option?
“The Unity exporter lets you publish 3D models straight from Unity to Sketchfab. It uses the glTF format and supports model objects and PBR materials”


#4

Did you mean export as .glb, not .gbl?

Thanks for the Unity exporter, that could be useful. You could take Collada exports from SketchUp, fix the materials in Unity, then export glTF.


#5

I am already exporting as gITF and .glb using the extension from @Centaur. I just need a bug fixed and a feature or two added. :slight_smile:


#6

SketchUp doesn’t have the many types of materials that Unity has, other than maybe if you’re using a render extension. I wouldn’t complain if SketchUp’s materials were as good as Unity’s!


#7

If the .glTF exporter recognized transparent textures in SketchUp, then that’d be pretty cool. And if the exporter recognized render textures from rendering extensions, but that’d be a lot harder because it’d have to be compatible with so many extensions.


#8

Hi,

Sorry for the late reply.

For metal roughness values, I’ve already included this as part of a release for another user.
Add the material attribute ‘pbr’,‘metallicFactor’, and ‘pbr’,‘roughnessFactor’ to override the defaults.

Double sided materials are not on by default, but if any face has its reverse side painted with the material, then that material will be marked as double-sided. The alternative would be to have two materials.


#9

I guess I should have read the first question :slight_smile:
The underlying issue is that there is no way for the Ruby API to inspect the PNG texture to determine if it has any transparency.

However, there is a very simple fix. Set the opacity of the material to 99%, that will indicate to the exporter that it needs to set the alphaMode property to BLEND, and that should solve the problem!