Jump to content

Multi-material issue in Blender render .babylon export


webGLmmk
 Share

Recommended Posts

I'm trying to import this multi-material mesh and there are some mesh faces just not showing.

This is what it looks like in Blender Render, materials display: note the smoothed out cone shapes going in to the mesh

speakers2.png

 

When I import it into the blender scene, it shows in the browser like this: Note the cone shapes are gone. You're seeing the spheres inside the box, which are not supposed to be visible except for the front exposed faces. The spheres are white because that is the base color i assigned initially (you have to do that in b. render). the black blotches on the front are where i assigned the exposed faces the dark grey color.  Ican't tell if babylon is rendering it black or those faces aren't showing either.

speakers3.png

 

Even weirder, when i create a playground example, THIS happens:

http://www.babylonjs-playground.com/#1HMKKM#1

all the darker materials are transparent. These would be the ones that were assigned AFTER the lighter base material. Some weird thing with that in the playground.

Fortunately its not that bad when i open in the browser. Only the grey cones are missing. They're all diffuse colors with a specular of about .5 . No textures or anything.  Showing absolutely transparent.

This is the second time I've modelled them, thought I screwed up the first one.

Any advice?

code for .babylon file: https://github.com/gson78/miscWebGLpages/blob/gh-pages/blender-scenes/custom-speakers4.babylon

 

Link to comment
Share on other sites

I looked at the .babylon file & the log file.  Since you do not use descriptive names for your materials, or include cameras / lights, cannot really tell that much or put it in the sandbox without camera lights.  Maybe put .blend in repository.

Things I notice:

  • you are using vertex colors.  Do not know if this is important, but it is not common.
  • you are not reusing your materials across speakers.  Should not affect outcome, but a resource waste.
Link to comment
Share on other sites

On 4/15/2016 at 8:48 AM, Deltakosh said:

This will require the help of our Blender god ( @gryff)

 

On 4/15/2016 at 10:26 AM, JCPalmer said:

I looked at the .babylon file & the log file.  Since you do not use descriptive names for your materials, or include cameras / lights, cannot really tell that much or put it in the sandbox without camera lights.  Maybe put .blend in repository.

Things I notice:

  • you are using vertex colors.  Do not know if this is important, but it is not common.
  • you are not reusing your materials across speakers.  Should not affect outcome, but a resource waste.

Ok so it actually has nothing to do with the materials. I created another file with some other shapes.  Another cone, cube, uv sphere, cylinder. I didn't assign materials, I just removed some of the faces facing the camera.

In Blender itself, once you remove faces, you can see the mesh still from the inside.

Once exported to a .babylon file and then used in babylon's engine,  you can only view meshes from an outside view of the faces. They only render/appear from an outside angle. Any view that should show the inside of the faces isn't rendered (resulting in transparency).

Playground example   http://www.babylonjs-playground.com/#1HMKKM#2

repo .babylon code:  https://github.com/gson78/miscWebGLpages/blob/gh-pages/blender-scenes/shapes_test1.babylon\

same scene hosted on github pages: (appears the same)

http://gson78.github.io/miscWebGLpages/shapes_test1.html

 

 

Link to comment
Share on other sites

Actually, you should only disable backFaceCulling when you need to see both sides at some point.  The default is true, since drawing the inside of a sphere or any closed object is a waste.  FYI, you can turn off backFaceCulling in Blender, and the setting goes into the .babylon file.  Picture below comes from Mapped Properties section of documentation.

gameRenderSettings.png

Since you only see one side of the cones, better to Flip their normals.  From edit mode, click menu: mesh->Normals->Flip Normals.

Link to comment
Share on other sites

On 4/17/2016 at 11:56 AM, JCPalmer said:

Actually, you should only disable backFaceCulling when you need to see both sides at some point.  The default is true, since drawing the inside of a sphere or any closed object is a waste.  FYI, you can turn off backFaceCulling in Blender, and the setting goes into the .babylon file.  Picture below comes from Mapped Properties section of documentation.

gameRenderSettings.png

Since you only see one side of the cones, better to Flip their normals.  From edit mode, click menu: mesh->Normals->Flip Normals.

That was what I needed. The problem with backFaceCulling is that you have to override your imported material to set it as False.  Thsi way, all I had to do was face select in Edit mode and flip the normals on only those faces.

Not sure why it shows differently in the playground... :  http://www.babylonjs-playground.com/#1HMKKM#5

But it looks right on my page http://gson78.github.io/miscWebGLpages/shapes_test1.html

GOOD TO KNOW thanks a lot.  Now to mess with lighting and hopefully sound processing. Hopefully I won't be back again too soon  ;-)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...