mirco Posted March 16, 2017 Share Posted March 16, 2017 Hi, i am new to BabylonJs. I have Imported a Mesh with BABYLON.SceneLoader.ImportMesh. Thats all works fine and super easy to learn. But now I have a problem with the color of the imported Mesh. Its a tree and should be (surprise) green. But it is Black, and only the top of the tree has a little pice of green. As test I created some other objects around it and checked if the other objects get the expected color ( pink ). To avoid problems with light or something like that. Maybe you have a short hint for me what I doing wrong. http://www.babylonjs-playground.com/#16XKTO#27 Thanks for your help Mirco Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 16, 2017 Share Posted March 16, 2017 Hello and welcome!!! Thank you for your kind words. You can use the debug layer to check your material properties (see picture). The materials of your tree are almost black Temechon 1 Quote Link to comment Share on other sites More sharing options...
mirco Posted March 16, 2017 Author Share Posted March 16, 2017 Hi thank you for your first informations. Because I have problems with seeing colors it`s not so easy for me. Before I submitted this post I have tested the tree with the same material like the other objects. Here are a playground: http://www.babylonjs-playground.com/#16XKTO#28 in this example it looks like it have the same problem. So maybe there are some more things I make wrong ? Attached I have a sample how it looks like in Blender. Mirco Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 16, 2017 Share Posted March 16, 2017 Can you share your blender scene? I'm pretty sure that our God of Blender (aka @gryff ;)) could help you Quote Link to comment Share on other sites More sharing options...
gryff Posted March 17, 2017 Share Posted March 17, 2017 @Deltakosh and @mirco: Nothing to do with Blender DK The camera and Directional Light are on opposite sides of the tree to each other. The light is illuminating the tree mesh on the side away from the camera. The side closest to the camera is essentially in shadow. I moved the camera to the same side of the tree as the light - see attached image. The tree has green branches cheers, gryff Quote Link to comment Share on other sites More sharing options...
mirco Posted March 17, 2017 Author Share Posted March 17, 2017 (edited) Thanks for the support you give me, but maybe I am thinking in a wrong direction but I already looked from the other side on the object ( like the shadows fall ) by moving the camera around. But only the top of the tree has the "green" or "pink" color like I expect. I have updated the playground for faster review. - override the green material with the pink one from the object near of it - move the camera on the right position - move the cane near the tree - thats what I expect to get - in the shape of a tree http://www.babylonjs-playground.com/#16XKTO#30 Edited March 17, 2017 by mirco change the picture to the new playground demo Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted March 17, 2017 Share Posted March 17, 2017 l. 6 & 34 : http://www.babylonjs-playground.com/#16XKTO#31 I've set a white scene ambientColor and a pink material ambientColor. I'm not sure if it's exactly what you want, but give it a try Quote Link to comment Share on other sites More sharing options...
mirco Posted March 17, 2017 Author Share Posted March 17, 2017 what I don't understand is why the cone is complete pink (on the side where the light is ) and the tree only has a little pink top, I would expect that they are looking the same because the form is "nearly" the same. http://www.babylonjs-playground.com/#16XKTO#30 1 hour ago, mirco said: Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted March 17, 2017 Share Posted March 17, 2017 I got it : smooth shading issue http://www.babylonjs-playground.com/#16XKTO#32 l. 62 object.convertToFlatShadedMesh() If you want control of your smooth shading : on Blender, apply a smooth shading on your object (3DView > Tool shelf > Tools tab > Shading Smooth button). Then, apply an edge split modifier, and adjust it. If you want to set flat shaded mesh directly from Blender, check "Use Flat Shading" on Mesh BJS panel. mirco 1 Quote Link to comment Share on other sites More sharing options...
mirco Posted March 17, 2017 Author Share Posted March 17, 2017 perfect, thats what I looking for so there are two ways to get the result I "expected": first export it correct in blender (see file attached) or convert it in babylon with myMesh.convertToFlatShadedMesh(); Thank you all for your help Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 17, 2017 Share Posted March 17, 2017 Ok thanks all for your help 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.