# glTF exporter - Opacity value not exported

**URL:** https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555
**Category:** ParaView Support
**Created:** [February 25, 2021, 3:42pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555 "2021-02-25T15:42:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![leopessanha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leopessanha/32/289_2.png) [@leopessanha](https://discourse.paraview.org/u/leopessanha)
#### Post date: [February 25, 2021, 3:42pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/1 "2021-02-25T15:42:36Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 25, 2021, 3:44pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/2 "2021-02-25T15:44:59Z")

</div>

@martink .

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

---

<div class="post-metadata">

### Author: ![leopessanha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leopessanha/32/289_2.png) [@leopessanha](https://discourse.paraview.org/u/leopessanha)
#### Post date: [February 25, 2021, 3:46pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/3 "2021-02-25T15:46:54Z")

</div>

Thank you, Mathieu.

I’ll try adding the opacity in CesiumJS then.

Best Regards,

---

<div class="post-metadata">

### Author: ![leopessanha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leopessanha/32/289_2.png) [@leopessanha](https://discourse.paraview.org/u/leopessanha)
#### Post date: [March 4, 2021, 5:19pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/4 "2021-03-04T17:19:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 5, 2021, 8:38am UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/5 "2021-03-05T08:38:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![leopessanha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leopessanha/32/289_2.png) [@leopessanha](https://discourse.paraview.org/u/leopessanha)
#### Post date: [March 5, 2021, 8:34pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/6 "2021-03-05T20:34:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2021, 9:01am UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/7 "2021-03-08T09:01:27Z")

</div>

Are you a C++ dev ?

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

---

<div class="post-metadata">

### Author: ![leopessanha](https://discourse.paraview.org/user_avatar/discourse.paraview.org/leopessanha/32/289_2.png) [@leopessanha](https://discourse.paraview.org/u/leopessanha)
#### Post date: [March 25, 2021, 2:07pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/8 "2021-03-25T14:07:04Z")

</div>

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_

```auto
"alphaMode" : "BLEND",
"doubleSided": true,

```

**The glTF files exported by ParaView looks like:**

```auto
"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:**

```auto
"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
         }
      }
   ],

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 25, 2021, 2:10pm UTC](https://discourse.paraview.org/t/gltf-exporter-opacity-value-not-exported/6555/9 "2021-03-25T14:10:49Z")

</div>

FYI @martink @Adrien_Boucaud @Michael
