leopessanha
(Leonardo Pessanha)
1
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?
mwestphal
(Mathieu Westphal (Kitware))
2
@martink .
Afaik, not all feature of glTF are supported by the exporter yet.
leopessanha
(Leonardo Pessanha)
3
Thank you, Mathieu.
I’ll try adding the opacity in CesiumJS then.
Best Regards,
leopessanha
(Leonardo Pessanha)
4
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.
mwestphal
(Mathieu Westphal (Kitware))
5
That seems like an easy fix to add in the exporter.
leopessanha
(Leonardo Pessanha)
6
For sure!
I have never contributed before, is there a guide on how to do it?
mwestphal
(Mathieu Westphal (Kitware))
7
leopessanha
(Leonardo Pessanha)
8
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
mwestphal
(Mathieu Westphal (Kitware))
9