-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FBXLoader: Add TransparencyFactor #17279
Conversation
There's also an FBX property Are you testing this change with any models? If so, can you share them? |
Model file is here. Tree.zip |
@looeee what do you want to do with this one? |
Sorry it took me so long to check this. It seems like the easy solution here is to manually set Treating TransparencyFactor as an alphaMap as in this PR is not correct since that makes the leaves transparent. At least in this case, it's presumably meant to be an alpha mask map, which could be handled in the loader like this:
However, when I do this, the mask is inverted: I'm not sure why this is happening, seem to be that material.alphaMap = texture;
material.alphaTest = 0.5; ... and material.map = texture;
material.alphaTest = 0.5; ...give inverse results, for the same |
I've found one more model that uses TransparencyFactor in this thread: facebookincubator/FBX2glTF#158 However, in that case it looks like a standard transparency map. They also note there that they've never encountered a model with this property before. Both of these files are created by a recent Blender version (2.79 and 2.80) so maybe they have started to use it. I've changed my mind on this - I think treating this the same way as |
@mrdoob this can be merged now. |
Thanks! |
Thank you! |
@safu9 thanks for your patience ^_^ And note that you probably still need to manually set |
I had warning message when loading fbx file,
THREE.FBXLoader: TransparancyFactor map is not supported in three.js, skipping texture.
Since TransparancyFactor seems to be another name of TransparentColor, I added it in FBXLoader.
Related: #11598