kurhlaa Posted January 20, 2018 Share Posted January 20, 2018 Hi, When I create a cube in Blender scene, add alpha transparency, then export it as *.babylon file - cube has extra diagonals, which badly affects how transparent cube looks. How they can be removed? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 20, 2018 Share Posted January 20, 2018 I don't see any extra diagonals - remember that squares are drawn as two trianges on a normal cube. Looks like your normals may be backwards on some triangles (actually it *looks* like cull_face or depth_test is not enabled on gl). Can you share your exported .babylon in a PG? Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted January 20, 2018 Author Share Posted January 20, 2018 54 minutes ago, brianzinn said: Can you share your exported .babylon in a PG Here is an example: http://www.babylonjs-playground.com/#MPS90E Left yellow box is imported and right blue box is a native BJS box. By "extra" diagonals I mean extra visible, because they are invisible with BJS native cube. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 20, 2018 Share Posted January 20, 2018 good PG. I've had similar issues that were fixed by checking face normals in Blender and using the Blender Render Engine instead of Cycles to check. If that's not it then perhaps share the blend. Cheers. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted January 21, 2018 Author Share Posted January 21, 2018 17 hours ago, brianzinn said: similar issues that were fixed by checking face normals in Blender and using the Blender Render Engine instead of Cycles to check. If that's not it then perhaps share the blend All face normals look the same, and "blender render" is a default in my case. My demo blend file attached scene2.blend Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 21, 2018 Share Posted January 21, 2018 You're right -- face normals are good in Blender. I would guess that it's something in the babylon exporter/importer. Should be somebody about tomorrow that can answer your question. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted January 24, 2018 Author Share Posted January 24, 2018 Anybody? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 25, 2018 Share Posted January 25, 2018 I took your blend, fixed the light, and added a plane also with the same material. I got rid of the edgesplit modifier on your cube, & added flat shading thru the exporter custom property. I also set the clear color, & lowered the alpha a little. I get similar results from both Blender & BJS. The colors are not a great match (probably differences in lighting implementation), but cannot produce your results. The color of both meshes is much less yellow, showing color blending. transparent.blend Blender top / sandbox bottom. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted January 25, 2018 Author Share Posted January 25, 2018 @JCPalmer, and you have never seen these diagonals like me? I've exported your Blender file info PG - http://www.babylonjs-playground.com/#MPS90E#1 What I get (yellow box has diagonals visible): Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 25, 2018 Share Posted January 25, 2018 Ok, you never said you were turning off backface culling, and it was not set in the .blend (it is not easy to find where). To isolate between a material problem, I just set the mesh builder box to the material from the export. It is a geo issue. The exported cube has 36 vertices (6 per side, which is correct for flat shading). I turned on debug, switched to meshes section. When I click mesh builder box, I see properties I have never heard of set ('hasVertexAlpha', & 'infiniteDistance'). The exported cube has no values for these. I am not really sure what I would even set them to, based on the blend. @Deltakosh, should these not have a default when not in a .babylon? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 25, 2018 Share Posted January 25, 2018 default values are set so the properties you mentioned as no effect Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 26, 2018 Share Posted January 26, 2018 Ok, first I just added those in the PG, and did not fix, so forget that. The meshbuilder only had 24 vertices, so I changed back to the edgesplit modifier & also switched to no back face culling. I exported with the latest addin & pasted with line breaks for more readability. Same result, so I did a run where I also wrote what the meshbuilder had for positions, normals, & indices to console. Here is a PG with the results of the console logs are in comments. You will notice that though both positions are -1 & 1, and normals are -1,0,1, the order / indices are not the same. I did not manually match up the 2 sets to see if they are exactly the same, but you can if you wish. If you paste the values for the meshbuilder box into the .babylon, you get the desired result. I do not know why, but it seems this effect is dependent on the order of specify vertices. The blender exporter writes vertices as they are provided, so I see no way to fix this on my end. 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.