-
-
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: Partial transparent maps doesn't work #12625
Comments
Since the model is on Sketchfab already, you can download the glTF version there. It looks correct with r88 GLTFLoader, other than some transparency artifacts that aren't loader-related. Preview on https://gltf-viewer.donmccurdy.com/: Issue in the FBX file looks similar to #11598 |
If you are setting |
That's good to know, thanks 🙂 the glTF asset from sketchfab doesn't set content.traverse((node) => {
if (node.isMesh) {
node.material.transparent = false;
node.material.alphaTest = 0.5;
}
}); i'm not getting the right result: |
I guess we can close this issue. |
GLTFLoader could be altered to do this automatically, assuming it shows the right result (currently it isn't for me; see above). Not sure whether the FBX format provides clear indicators of when alphaTest should be changed or not though, to enable FBXLoader to do it automatically. |
haven't used the GLTFLoader yet. |
@cnspaha I've just done this: loader.load( 'models/fbx/succubus.fbx', function( object ) {
object.traverse( function( o ) {
if ( o.isMesh === true ) {
o.material.alphaTest = 0.5;
}
} );
scene.add( object );
} ); |
@Mugen87 |
close this, since it doesn't seem possible to check if there such parts contains alpha. |
I followed up about why the glTF version doesn't render correctly; there is an unexpected case in the format spec. Will post more updates here: KhronosGroup/glTF#1158 |
@donmccurdy how is this indicated in GLTF? I'll take a look and see if there is anything similar in FBX. |
@looeee glTF sets https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#alpha-coverage |
There's an enum AlphaSource in FBX, unfortunately the documentation is as usual pretty sparse (documentation as comments here): {
eNone, // no alpha
eRGBIntensity, //RGB Intensity (computed).
eBlack // Alpha channel. Black is 100% transparency, white is opaque
}; I wonder if EDIT: tested with a few models including this one, and I can't find any where this enum is actually set... so I guess we are stuck with doing it manually. |
i have same problem.
i can see is there any solution for this? |
Description of the problem
When loading a FBX file ( 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:
What it should look like Sketchfab
What it really looks like (my viewer):
The problem can be worked around with when applying following code on every mesh the FBXLoader creates:
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
Browser
OS
The text was updated successfully, but these errors were encountered: