I am trying to create a table top which has a glass like transparent surface. The model was in blender, exported as gltf and the exported gltf is rendered fine in gltf-viewer as well as in Win10 3D viewer. However, in a panda3D script the surface is never visible, possibly being fully transparent/never rendered. This maybe related to the “Transparency and Blending” issues in the manual, but I couldn’t fix with the suggestions there on transparency attribs and other attempts such as disabling auto shader. Basically there is a material attached a geometry with an alpha color.
I’ve attached a small python file to simulate the issue and the gltf file.
Here is the relevant gltf material section that has the alpha blending mode.
{
"alphaMode" : "BLEND",
"doubleSided" : true,
"name" : "table_top",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
0.8000000715255737,
0.7112227082252502,
0.7378523349761963,
0.43299999833106995
],
"roughnessFactor" : 0.15199999511241913
}
}
And the code snippet:
super().__init__()
gltf.patch_loader(self.loader)
model = loader.load_model(r'glass1.gltf')
model.reparent_to(self.render)
alight = AmbientLight('alight')
alight.setColor((1, 1, 1, 1))
alnp = render.attachNewNode(alight)
self.render.setLight(alnp)
self.cam.set_y(-50)
self.render.setShaderAuto()
Appreciate your suggestions.