Zino54220 Posted October 11, 2014 Share Posted October 11, 2014 Hi gentlemen! I have a big problem and I can't resolve it alone... I created a scene in Blender v2.71 and I have this render : But unfortunately, I have this render in my browser with Babylon 1.12, 1.13 and 1.14-beta.js : I think I forgot a parameter or anything before export... I need help Thanks. Zino Zino54220 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted October 11, 2014 Share Posted October 11, 2014 Zino, It looks like you may have issues with the normals.in your Blender file. Try this: 1. Select an object2. Then go into Edit Mode ->Select All Vertices (tap the A key until all verts are selected)3. Now, still in Edit Mode, go to Mesh-> Normals->Recalculate Outside. Repeat steps 2 and 3 for each object in the scene. Hope that helps. cheers, gryff Quote Link to comment Share on other sites More sharing options...
joshcamas Posted October 11, 2014 Share Posted October 11, 2014 Looks really cool! Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 12, 2014 Author Share Posted October 12, 2014 Thank you for your answer Gryff. I made your corrections but it's the same result... I tried to apply "Mesh" -> "Normal" -> "Recalculate Inside" and "Flip Normals" to see differents... but always the same result. Maybe there is a thing link to the texture ??? Zino PS : Thanks you for your comment Joshcamas, but if I don't resolve this problem, my projet will go to the trash... Quote Link to comment Share on other sites More sharing options...
gryff Posted October 12, 2014 Share Posted October 12, 2014 Zino, can you post the .blend file somewhere - so I can have a look? I'm sure the issue is with Blender. By the way what version of Blender do you use? cheers, gryff Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 12, 2014 Author Share Posted October 12, 2014 I send you a private message with the blender file and I use the version v 2.71 Quote Link to comment Share on other sites More sharing options...
gryff Posted October 12, 2014 Share Posted October 12, 2014 Zino, I have taken a look at your.blend file. And there is one issue I can see and one possible issue.(See pic below) Possible IssueThe image below is just the "GradinA.001" object viewed in Edit Mode. I have labelled some faces with an "N". These faces are NGONS - I have no idea how the BJS exporter handles such faces. One Issue.The "GradinA.001" object has 3 materials - MaterialGradin, MaterialGradinVitre (coloured blue in the image) and MaterialGradinArmatureVitre (coloured red in the image) The materials MaterialGradinVitre and MaterialGradinArmatureVitre are applied to surfaces that are flat - they do not have "depth" - like a plane but not a box. MaterialGradin has a mixture - some box-like surfaces and some plane-like surfaces. I have coloured the plane-like surfaces green. For plane-like surfaces BJS defaults to drawing one side only which is happening with your model. This default behaviour can be changed for example by changing the "backFaceCulling" parameter for materials like MaterialGradinVitre to false - either using a script or by opening the .babylon file, finding your material and changing "backFaceCulling":true to "backFaceCulling":false . That is where I am so far. I will try an experiment later today to investigate NGONS. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 12, 2014 Share Posted October 12, 2014 @Gryff: Is it possible to specify backFaceCulling per material inside Blender? Quote Link to comment Share on other sites More sharing options...
gryff Posted October 12, 2014 Share Posted October 12, 2014 @Gryff: Is it possible to specify backFaceCulling per material inside Blender? Not that I know of DK. I tend to stay away from geometry/meshes that are not closed But I will explore a little more. Also added a comment about the "Backface Culling in the Blender shading panel on the other thread cheers, gryff GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 12, 2014 Author Share Posted October 12, 2014 Thanks for your time Gentlemen. Here, the render after the manuel correction in the .babylon file , the recalculate and Flip direction manipulations : It's a little better but the same result... Zino Quote Link to comment Share on other sites More sharing options...
gryff Posted October 12, 2014 Share Posted October 12, 2014 Ok Zino - I did a little experiment with one of the stands - removed all other objects. I created new objects from the parts I had previously identified as being problem surfaces because of backFaceCulling. - the red, green and blue areas in the picture above. I adjusted the position of the stand so it was at the centre of the scene. Added a camera and a hemi light. Exported the scene to babylon. Opened the babylon file and set backFaceCulling to false for the red, green and blue materials. Here is the result: A Stand I missed a few surfaces that are in the concrete area - but they are fixable. The red, green and blue materials - are now showing both sides. And the areas that are NGONS are fine in the exporter. So it is fixable. cheers, gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 12, 2014 Share Posted October 12, 2014 On NGONS: FYI, There is a line in the exporter right before the recording of vertices starts:Mesh.mesh_triangulate(mesh)This was in there before I did anything, though for TOB the call is slightly different. mesh_triangulate is: @staticmethod def mesh_triangulate(mesh): try: import bmesh bm = bmesh.new() bm.from_mesh(mesh) bmesh.ops.triangulate(bm, faces = bm.faces) bm.to_mesh(mesh) mesh.calc_tessface() bm.free() except: passThis I believe this turns everything into triangles. For .blends defined with all triangles, there is nothing to do. Does not answer the questions, just filling in background as to why I think that part works. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 13, 2014 Share Posted October 13, 2014 @Gryff: Is it possible to specify backFaceCulling per material inside Blender?Yes, I did it with the multi_group.blend, in the Blender-test directory. When the drop down at the top says "Blender Game", not Blender Render" you select the mesh with multi materials. In the Material Properties, there is now a sub-division called "Game Settings". There is a check box for culling. Click a material, check it. Switch materials & it is un-checked. Change back and it is checked. I do not know what I am doing when I run Blender, but sometimes I guess that just does not matter. Quote Link to comment Share on other sites More sharing options...
chg Posted October 13, 2014 Share Posted October 13, 2014 To me the difference seems to be a lack of lighting (though the dithered greyscale adds to the uncertainty of what I'm looking at) I notice you have no lights as direct children of the scene, and wonder if that might be part of the export issue? Quote Link to comment Share on other sites More sharing options...
gryff Posted October 13, 2014 Share Posted October 13, 2014 This I believe this turns everything into triangles. Jeff, I figured that as the piece I used from Zino's file with NGONS worked - but of course had no idea how ;-) I do not know what I am doing when I run Blender, but sometimes I guess that just does not matter. Blender has so many "nooks and crannies" - you never know what you can find ... or where. I've never experimented with the games engine and only since 2.71 with the cycles renderer (as now it is possible to bake out materials created with it to a texture). Each day I learn something more about Blender. - and with each new feature added with each new version - the learning process does not stop cheers gryff Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 13, 2014 Author Share Posted October 13, 2014 chg : I use 8 spots lights parenting to an object above the arena in center of the scene so I don't think the problem comes from that... Initially, I used an area lamp in more but when I exported the scene, I had an error on the area lamp : "not attribute use sphere" or anything like this, so I deleted it to make my export... I will try tonight to add an hemi or an area lamp without link it to a mesh to see differences... Zino. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 13, 2014 Author Share Posted October 13, 2014 A little point... Althought I tried many parameters in Blender with the advices of Gryff, I always found the same result... I simply remade a scene and, element by element, I checked the export in the browser to get that I want. I add an hemi lamp and I have this render : So, chek often your result in the browser gentlemen! I take this opportunity to report an error in Blender with the exporter and a area lamp. Maybe because I forgot a parameter or anything... Zino Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 13, 2014 Share Posted October 13, 2014 Did you use the latest version I published yesterday? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 13, 2014 Share Posted October 13, 2014 DK, I think it was the original. TOB does not have an export_light() syntax. Probably means there is still a problem. Was try to get operational today. Guess this was just the day everyone is using Blender. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 13, 2014 Share Posted October 13, 2014 I checked the new version and this sounds like this is already resolved Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 13, 2014 Share Posted October 13, 2014 Good, he also failed to say "I also get this log file thing", which is a good to tell they are out of date. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 14, 2014 Author Share Posted October 14, 2014 DK, yes I used the version updated sunday and I used the babylon exporter, not Tower Of Babel. Should I use TOB rather than babylon exporter ? Zino Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 14, 2014 Share Posted October 14, 2014 Tricky question. Tower of Babel no-longer exists, at least in name, in the main Babylon repository. The only exporter there now, updated late Sunday night even for New York time, is a version of Tower of Babel, with only the .babylon & .log file outputs. The only change to the content is that this version does not output shape keys. Unfortunately, there are multiple ways we could both be "right". First, the version Blender uses seems to be the one present when Blender is launched. The second is how you installed it. Before 2.71, you could either just put the file into the addons directory, then go to file->User Preferences Addons tab & enable it. This method did not work in 2.71 without throwing in some other directory as well. The other way is to go to file->User Preferences, and click the "Install from file..." button at the bottom. If it is a replacement, you still need to stop / start Blender for it to use it, but it is the only file you need. If you have done it the copy file way, then delete it. This way puts it somewhere in your home directory tree. If you leave it, then when you go to Addons tab, you will see a warning about a conflict, and I think unpredictable results. Deleting the addons dir version makes it go away. The syntax of the function export_...(), in your error message & lack of log file means regardless of what you did, the older code was run. So yes, use what is there now, installed using the button. Quote Link to comment Share on other sites More sharing options...
Zino54220 Posted October 15, 2014 Author Share Posted October 15, 2014 Thanks JCP I will exploit the .babylon file from TOB exporter now. Quote Link to comment Share on other sites More sharing options...
Nikos Posted January 5, 2015 Share Posted January 5, 2015 Does webgl support ngons http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.63/BMesh 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.