# FBXLoader Texture / Transparency Process

**URL:** <https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748>\
**Category:** Questions\
**Tags:** transparency, fbx-loader\
**Created:** [August 10, 2018, 2:17pm UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748 "2018-08-10T14:17:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Markus1](https://discourse.threejs.org/u/Markus1)\
**Post date:** [August 10, 2018, 2:17pm UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748/1 "2018-08-10T14:17:31Z")

</div>

I want to load a FBX character out of Blender into three.js. It has some transparency on its hair. As in the image below, the hair is in parts showing right, in parts not. Some haitips,the part that should be transparent and show the hair underneath, is showing the head. But some hairtips seam to work correctly.!  
What is this? Is this because of the renderprocess or the texture itself?  
In the Web-Console I have this info/warning:  
THREE.FBXLoader: TransparencyFactor map is not supported in three.js, skipping texture.  
TransparencyFactor map?  
How can I make the hairstrains all look the same and correct?  
Thanks for the help.

![Transparency%20Hair](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/2/2c71e8d8625024864ce43d67c5235bf8c3140bbc.jpeg)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [August 10, 2018, 4:42pm UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748/2 "2018-08-10T16:42:15Z")

</div>

It seems your link does not work. Can you please have a look?

---

<div class="post-metadata">

**Author:** ![Markus1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Markus1](https://discourse.threejs.org/u/Markus1)\
**Post date:** [August 13, 2018, 7:23am UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748/3 "2018-08-13T07:23:41Z")

</div>

Thanks… It should work yet.

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [August 13, 2018, 10:27am UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748/4 "2018-08-13T10:27:00Z")

</div>

Have a look at these two issues on Github:

> <https://github.com/mrdoob/three.js/issues/11598>
>
> \##### Description of the problem 
> 
> When importing FBX, some transparency infor…mation is lost.
> 
> Using the FBX loader example from Threejs.org site, just loading different model. Model at pearl\_walk.fbx to http://webglworkshop.com/fbx/standing\_idle.fbx
> 
> Looks like this
> !\[image\](https://user-images.githubusercontent.com/2813834/27481051-a9555454-5812-11e7-8dfd-615aa0d5da53.png)
> 
> Should look like this (from PlayCanvas) Note: PlayCanvas uses "Alpha to coverage"
> !\[image\](https://user-images.githubusercontent.com/2813834/27481301-da09ee7e-5813-11e7-9565-d5ea35c052aa.png)
> 
> or this (from SketchFab)
> !\[image\](https://user-images.githubusercontent.com/2813834/27481512-d4d4bbae-5814-11e7-97ba-888083923b82.png)
> 
> 
> 
> 
> \##### Three.js version
> 
> \- \[\] Dev
> \- \[x\] r65
> 
> \##### Browser
> 
> \- \[x\] All of them
> 
> \##### OS
> 
> \- \[\] All of them
> \- \[x\] Windows
> \- \[\] macOS
> \- \[\] Linux
> \- \[\] Android
> \- \[\] iOS

> <https://github.com/mrdoob/three.js/issues/12625>
>
> \##### Description of the problem 
> 
> When loading a FBX file ( \[succubus.zip\](ht…tps://github.com/mrdoob/three.js/files/1461582/succubus.zip), it is the original file, no export ) via FBXLoader transparent parts of a map isn't taken into account.
> 
> The map, opened in Gimp so you can see the transparent parts, hair + feathers:
> !\[unbenannt3\](https://user-images.githubusercontent.com/22448974/32662101-a4f09218-c629-11e7-8630-c2dececf4c15.PNG)
> 
> What it should look like \[Sketchfab\](https://sketchfab.com/models/8c0746e3d1304ed283a3bb4772a8d2cc)
> !\[unbenannt\](https://user-images.githubusercontent.com/22448974/32662105-ab47fdc2-c629-11e7-8d8b-e7948e2f8457.PNG)
> 
> 
> What it really looks like (my viewer):
> !\[unbenannt2\](https://user-images.githubusercontent.com/22448974/32662109-aebf165c-c629-11e7-9dac-749c9c5fc8c5.PNG)
> 
> 
> The problem can be worked around with when applying following code on every mesh the FBXLoader creates:
> \`\`\`typescript
> ((obj as THREE.Mesh).material as THREE.Material).transparent = true;
> ((obj as THREE.Mesh).material as THREE.Material).side = THREE.DoubleSide;
> ((obj as THREE.Mesh).material as THREE.Material).alphaTest = 0.5;
> \`\`\`
> 
> But of course I don't want this code to be applied on every mesh because AFAIK transparency and alpha testing costs quite a bit of performance, especially if it isn't needed...
> 
> I am willingly to make a PR if I would know how to fix this.
> 
> One possible solution is that we would have to check ONLY the PART of the image being used per mesh if there is any transparency and if there is some then setting the transparent parameter on the material.
> 
> @Kyle-Larson @takahirox since you both wrote this Loader, do you have any idea?
> @Mugen87 @donmccurdy you both are pretty active on loader issues/PRs probably you could help here too? ;)
> 
> 
> \##### Three.js version
> 
> \- \[x \] r88
> 
> \##### Browser
> 
> \- \[x\] All of them
> 
> \##### OS
> 
> \- \[x\] All of them

A possible workaround is to use this:

```js
object.traverse( ( child ) => {
  if ( child .isMesh) {
    child .material.transparent = false;
    child .material.alphaTest = 0.5;
  }
});

```

However, it is at best a partial workaround and doesn’t give great results for hair.  
Can you also try loading your model in Sketchfab and see what the results look like there?

Regarding this warning:

> THREE.FBXLoader: TransparencyFactor map is not supported in three.js, skipping texture

There are a number of texture map types in FBX that cannot be supported by three.js. The transparency map should go into the alpha / opacity / transparency color map slot, not the transparency level slot. I’m not sure what this is called in blender.

If there is only one such slot in Blender it’s possible that the blender exporter is outputting the transparency map in the wrong place (there are a number of such bugs in that exporter). Can you share your model and I’ll take a look?

---

<div class="post-metadata">

**Author:** ![Markus1](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Markus1](https://discourse.threejs.org/u/Markus1)\
**Post date:** [August 14, 2018, 7:50am UTC](https://discourse.threejs.org/t/fbxloader-texture-transparency-process/3748/5 "2018-08-14T07:50:45Z")

</div>

Thanks for the answers.

Here is the model and the texture…  
I deleated the model here, because it should not be in here all the time…

For the material I use the line:  
var material = new THREE.MeshPhongMaterial({ skinning: true, shininess: 15, opacity: 1.0, morphTargets: true, map: texture, transparent: false, depthWrite: true, depthTest: true, alphaTest: 0.5 });

I played around with all the parameters but nothing changes.
