Question

Transparency issue while transforming OBJ to GLTF.

  • 8 April 2020
  • 1 reply
  • 1 view

I tried converting a OBJ to GLTF.It got converted properly.But the gltf output is transparent.

the mtl of OBJ is:

newmtl texture

Ns 26.4

d 1

illum 2

Kd 1 1 1

Ka 0.2 0.2 0.2

Ks 0 0 0

map_Kd nzl_akl_003.png

 

and the gltf output material is :

"materials" : {

"mat_0" : {

"name" : "texture",

"extensions" : {

"KHR_materials_common" : {

"technique" : "PHONG",

"values" : {

"ambient" : [ 0.2, 0.2, 0.2, 1 ],

"diffuse" : "t_0",

"specular" : [ 0, 0, 0, 1 ],

"shininess" : 128

},

"transparent" : true

}

}

},

The transparency of the gltf is set true by default.How to change this while conversion.I dont want the model to be transparent.What could be reason for by default transparency of the model.How to change this.I cant share the entire data.


1 reply

Userlevel 1
Badge +10

Hi @san!   A colleague of mine suggests that the 

transparent
 flag is set to true set because the texture likely has an alpha band. Converting the texture to a jpeg should result in this flag being removed. However, it is tough to modify a texture which is already on a feature. Some combination of SharedItemXXX transformers (i.e. SharedItemRetriever, SharedItemAdder, etc.)  and a 
RasterBandRemover
 would be required. Hope this helps!

Reply