Jump to content

how to set the default material to an imported mesh?


Bombinosh
 Share

Recommended Posts

Hi everybody!

I'm currently learning to use this fabulous js framework... Firstly, congrats to any "git committer" of Babylon!

I imported a basic mesh into babylon, from blender.

below the '.babylon' file content:
 

{"autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],"materials":[],"multiMaterials":[],"skeletons":[],"meshes":[..noob mesh datas..],"cameras":[],"lights":[],"shadowGenerators":[]}

As you can see, nothing fancy about the metadatas.

Now, i can see the mesh on my scene alright.

Currently, i'm working on mesh positioning, and the scene is filled with basic meshes (only cylinders created with BABYLON.Mesh.CreateCylinder), with the default material(material property not set).

I did not use any material or light on the imported mesh, so i thought it will look like the others meshes i had on the scene, but it's not the case.

The imported mesh is fully black, and the diffuse and specular reflections are visible but seems miscalculated

I tried to set the default material to the imported mesh, but the render is the same.

What could be wrong? I can provide a picture if needed.

version : babylon.2.1-beta

blender version : 2.75a

Link to comment
Share on other sites

Hello Deltakosh, thanks a lot for your reply!

 

I'm trying to do a shape composed by a cylinder ending by a bevel.

images 1 and 2 are screenshots taken from the "bevel" in the blender workspace,
and the others are taken from the html canvas.

I would like that the two meshes seems like one when they are sticked together.
it is particularly obvious on image 6 that it's not the case right now...
 

I don't think it's a blender problem, because there is not much in that mesh aside from vertices datas.

 

It's probably just a little tweak missing somewhere on the material. What do you think?

 

 

PS : you may say that there is too much vertices on the bevel, but i would like to be able to scale him up big time with a good render. I'm guessing that having a lot of vertices will help but i don't know much...

 

 

The babylon file is joined as attachment, and some pictures as well.

SelectorBevel.babylon.txt

post-15854-0-67553400-1439241298_thumb.p

Link to comment
Share on other sites

And voila, With an hemispheric light.

 

I'm not sure what you mean by more normals, i need to add even more vertices in blender? I can try that, but i don't understand why the render is like this in the first place.

 

Ah, this problem is related to the shadow settings in blender maybe? Sorry, i'm a padawan with blender too. I will dig into that.

post-15854-0-02092500-1439242567.png

post-15854-0-53153500-1439243424.png

Link to comment
Share on other sites

Just a random guess, but might that help: http://blender.stackexchange.com/questions/734/how-to-smooth-shade-an-object-while-retaining-hard-edges ?

 

It seems like the tube has those hard edges and the ending thingy doesn't. So maybe just use an Edge Split modifier and apply it? (I remember I had a similar looking problem a while ago and if I remember right that helped, but I have not much clue about blender and shading and all that stuff, ssooo... it's really just a guess :P )

Link to comment
Share on other sites

Yep, you nailed it!

 

The little mesh was with flat shading. I changed it to smooth and applied an edge Split modifier (which add normals to the mesh, in consequences of the edge splitting).

 

The smooth shadow gave me the nice light reflection and the edge split modifier did the hard edges.

 

My bad, It was just a blender problem...

 

Thanks for your help! Much appreciated.

post-15854-0-37158400-1439320701.png

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...