glTF exporter - Opacity value not exported

Hi, I’ve exported a scene in ParaView using the glTF extension.

The scene contains a vtkStructureGrid, colored by a scalar and with 0.35 value for opacity.

When loading the data in the destiny application(CesiumJS) the geometry and color are okay but there’s no opacity.

Does anyone have any tips on this?

@martink .

Afaik, not all feature of glTF are supported by the exporter yet.

Thank you, Mathieu.

I’ll try adding the opacity in CesiumJS then.

Best Regards,

Hi!
ParaView does export the opacity, but it does not add the following line in the materials node:

"alphaMode" : "BLEND",

After adding it, it works just fine.

That seems like an easy fix to add in the exporter.

For sure!
I have never contributed before, is there a guide on how to do it?

Are you a C++ dev ?

If yes, you can start here:
https://gitlab.kitware.com/paraview/paraview/blob/master/Documentation/dev/build.md

I am not a C++ developer, but I have learned some in cs college.
As soon as I have the time, I will try to get up to speed with C++ to help.

The writer could use another fix, besides not adding the property alphaMode it does not add the property doubleSided

"alphaMode" : "BLEND",
"doubleSided": true,

The glTF files exported by ParaView looks like:

"materials" : 
   [
      {
         "pbrMetallicRoughness" : 
         {
            "baseColorFactor" : [ 1.0, 1.0, 1.0, 1.0 ],
            "baseColorTexture" : 
            {
               "index" : 0,
               "texCoord" : 0
            },
            "metallicFactor" : 0.0,
            "roughnessFactor" : 1.0
         }
      }
   ],

To have transparency and no backface culling they should look like:

"materials" : 
   [
      {
        "doubleSided": true,
        "alphaMode": "BLEND",
        "pbrMetallicRoughness" : 
         {
            "baseColorFactor" : [ 1.0, 1.0, 1.0, 1.0 ],
            "baseColorTexture" : 
            {
               "index" : 0,
               "texCoord" : 0
            },
            "metallicFactor" : 0.0,
            "roughnessFactor" : 1.0
         }
      }
   ],
1 Like

FYI @martink @Adrien_Boucaud @Michael