Closed vcxyk closed 4 years ago
Could you share the model with us please? A solution would be enable the twoPassesOneSide
rendering mode. See https://google.github.io/filament/Materials.md.html#materialdefinitions/materialblock/blendingandtransparency:transparency There's a screenshot showing exactly the problem you are running into.
@prideout I wonder if we should add an option in gltfio
to be able to turn on that mode. We didn't turn it on by default because it's not what some models want. Wdyt?
Alternatively make sure the winding of all your faces is correct. What you are seeing could also be z-fighting, making sure that your triangles are not too close to each other would help.
Could you share the model with us please? A solution would be enable the
twoPassesOneSide
rendering mode. See https://google.github.io/filament/Materials.md.html#materialdefinitions/materialblock/blendingandtransparency:transparency There's a screenshot showing exactly the problem you are running into.@prideout I wonder if we should add an option in
gltfio
to be able to turn on that mode. We didn't turn it on by default because it's not what some models want. Wdyt?Alternatively make sure the winding of all your faces is correct. What you are seeing could also be z-fighting, making sure that your triangles are not too close to each other would help.
hi, Thanks for you reply. Here's the model. test_glasses.glb.zip
append: I tried modified the MaterialGenerator's default "blend" behavior to twoPassesDoubleSides, and the problem is gone.
(ps: The default blending value is "fade" and I don't know why it's not "transparent", which is more fit for the glass specular. And It also confuses me that the depth-writing is set to 'true' explicitly for blending mode. False seems ok for my tests.).
(pps: TwoPassesOneSide solve Problem.1 above but the Problem.2 still exists.)
The problem is that gltf doesn't define how blending should work. Some models expect fade, other expect transparent. I'm surprised we picked fade though. @prideout do you remember?
Setting depth writing to true for transpent objects helps with some models.
What is the transparent skin you're talking about?
Apparently we use fade to match other viewers, see bug https://github.com/google/filament/issues/1461
What is the transparent skin you're talking about?
Look at the legs behind the glass piece. It has a "transparent" plastic part and a 'opaque' steel inside. But through the glass we can only see the steel, and the plastic is not rendered. (Is it depth-culled by the glasses in front during the transparent rendering pass?)
For that not to happen you need to make sure the sides of the frame (the "legs”) are separate objects.
I finally tested your model. Some info:
Anyway I don't think there's anything actionable on our side aside from maybe offering a TRANSPARENT mode for glTF instead of always using FADE.
Note that we switched from TRANSPARENT to FADE to "fix" issue #1461.
I would rather not make this configurable since it would double the number of ubershader permutations. It's impossible to make everybody happy when transparency in involved. :)
I know but fade is very very wrong for glass :)
hi, I have a 'glb' glasses model exported from substance painter, which is combined with several parts of transparent submeshes. It seems the mesh sorting algorithm cannot perfectly rendering such glb models. How can I avoid all these rendering errors in Filament 1.7.0, or is there any suggestion for making such models to reduce those rendering errors?
Same .obj file rendered by Mac file preview: