Rodrix3 Posted April 1, 2018 Share Posted April 1, 2018 Hi there! We are migrating from ThreeJs to Babylon and we are facing a road blocking issue. Our workflow is using 3ds studio Max and the Babylon Converter, however we are testing both glb and babylon formats and still we cannot get the model to export correctly. After the export, the mesh looks as if it was incomplete. However when you move the camera the mesh completes itself and then another part of the mesh looks incomplete. It is as if the depth buffer was not on, I can see "through" the mesh, all in weird ways. I am not sure *what* is wrong. I have provided both the glb and babylon exported files. I would really appreciate if anyone can help me. If I cannot solve this, our whole project will fail, along with months of work, and we will have to stick with ThreeJs or another engine... Thank you in advance, Your help will be really really appreciated. Please help. Rod piano.glb piano.babylon Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 1, 2018 Author Share Posted April 1, 2018 Here is an image of what is expected and what I am getting: Quote Link to comment Share on other sites More sharing options...
Guest Posted April 2, 2018 Share Posted April 2, 2018 Can you also provide the .max? Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 2, 2018 Author Share Posted April 2, 2018 Thanks Deltakosh. If you can help me with this, you would make my day (and my week!). I am attaching the Max file in 2016 and 2018 3ds format. Piano Frame.max (2018 Max) Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 2, 2018 Author Share Posted April 2, 2018 Max 2016 version attached. @Deltakosh, a million thanks in advance. Piano Frame2016.zip Quote Link to comment Share on other sites More sharing options...
Guest Posted April 3, 2018 Share Posted April 3, 2018 Pinging @noalak to help @Rodrix3 do you mind creating an issue here: https://github.com/BabylonJS/Exporters Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 3, 2018 Author Share Posted April 3, 2018 2 minutes ago, Deltakosh said: Pinging @noalak to help @Rodrix3 do you mind creating an issue here: https://github.com/BabylonJS/Exporters Hi @Deltakosh. Thanks so much for looking into this. I don't mind creating an issue on the GitHub but honestly I don't what the "issue" is. Meaning, is this a problem of normals not exported correctly? Or transparency? Or a limit in the number of polygons? Or a depth buffer issue? Unfortunately, I cannot tell what is the issue other that the object doesn't look how it should. Can anyone at least identify what the issue is before I post it on GitHub so I can provide more information other than it looks "strange". @noalak, do you think you could help? Thanks so much in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted April 4, 2018 Share Posted April 4, 2018 So we figured it out It is a transparency issue. In your case you may want to read: http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered You should try to use needDepthPrePass like here: https://www.babylonjs-playground.com/#1MSIXB#8 (see line #42) Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 5, 2018 Author Share Posted April 5, 2018 Hi @Deltakosh. Thanks for the reply here. I have been following the issue that I created. It is here for others to see: https://github.com/BabylonJS/Exporters/issues/132#issuecomment-378498179 I believe that both Sandbox, Editor, and Built-in Server should check if the glb needs needDepthPrePass and assign it automatically, in the same way that ThreeJs does. It is very frustrating for migrating users, that they can't even preview the exported meshes quickly, and cannot use neither the Editor, Sandbox, or built-in server that comes with the Babylon Exporter to test. What do you think? Thank you so much! P.s: There is an additional thing that confuses me. All the sample meshes I provided, and even further the simple cone provided by @tkazik do NOT have transparency. And even, so, the faces were "flipped". This makes me insist that this an exporter issue... The export should have never been set with BLEND on to begin. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2018 Share Posted April 5, 2018 If you are sure that your scenes should not have Blend then yes it is a bug: Pinging @noalak to do a test There is no way to know if needDepthPrePass is required as some users do not want it. In your case you want it but for people who may want multiple transparent layers (a window seen through another window) then it won't work. Three.js decided to go with needDepthPrePass = true by default but in this case a lot of meshes won't display correctly (like all Minecraft exported models for instance). This is why I told you this is not a bug. Unfortunately the glTF spec does not have a way to indicate if users want the depth prepass. But this is something we should perhaps consider (pinging @bghgary for awareness) Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 5, 2018 Author Share Posted April 5, 2018 1 hour ago, Deltakosh said: If you are sure that your scenes should not have Blend then yes it is a bug: Pinging @noalak to do a test I don't have anything with blend or transparency on my scenes. I am exporting things that are pretty basic shapes with few polys. Thanks so much @Deltakosh Quote Link to comment Share on other sites More sharing options...
bghgary Posted April 5, 2018 Share Posted April 5, 2018 Quote Unfortunately the glTF spec does not have a way to indicate if users want the depth prepass. But this is something we should perhaps consider We did consider when writing the spec. This is what we ended up saying in the specification. https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#alpha-coverage Quote BLEND - Support for this mode varies. There is no perfect and fast solution that works for all cases. Implementations should try to achieve the correct blending output for as many situations as possible. Whether depth value is written or whether to sort is up to the implementation. For example, implementations can discard pixels which have zero or close to zero alpha value to avoid sorting issues. What this practically means is that content authors should use separate meshes to allow sorting to work properly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.