Myjestic Posted October 20, 2017 Share Posted October 20, 2017 Hi, I fiddled around a bit with the Sandbox and the editor. If I open my babylon file in the sandbox, colors and light are displayed. If I open it in the editor everything is just black. I couldn't find out what's causing this, maybe someone knows the answer. Adding a light source did not help. untitled-scene.babylon Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 20, 2017 Share Posted October 20, 2017 Ping @Luaacro who is the mastermind behind the editor Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 20, 2017 Share Posted October 20, 2017 Hi Guys! Myjestic... in the editor, try adding a hemispheric light to the scene. Then the scene will light-up. But, tops are dark, and bottoms are bright. So we need to re-direction the new hemi light. SO... if you want to set your newly-added Hemispheric Light direction in a better way... 1. Choose "new Hemispheric Light" from Scene -> alaman_scene list... at bottom of long list on right side of editor. 2. Now choose "Light" tab on left panel area. 3. Set Direction x = 0, y = 1, z = 0 (aim light towards sky, so it can reflect-back properly) 4. Optional: Set Ground Color to r: 0.5 g: 0.5 b: 0.5; (A nice gray... if wanted - to light-up the bottoms a bit. ) untitled-scene.babylon has no lights within it. Other types of lights could be added, too... but require a bit more work. Point lights must be positioned properly, directional lights must be more-accurately direction-set, and and spot lights need precise positioning and direction-setting. The hemispheric light is somewhat easier, although we still needed to set its direction and ground color. It would be nice if the editor set hemi light direction to 0, 1, 0, and ground color to 0.5, 0.5, 0.5 ... automatically, when hemi light is added. At least the hemi light intensity was NOT set to 0, by default, in the editor. Luaacro, I hope I didn't ruin your question-answering fun. Hope this helps. Talk soon. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 21, 2017 Share Posted October 21, 2017 Oops, I forgot about the colors issue. Here's some data from the .babylon file... which I viewed via loading it into an online JSON viewer. Default.003 might be a tiny bit green, but generally, things look a little gray... and black. I think you need to "power-up" those colors a bit. For green... 0, 1, 0... or if you want to get crazy... 0, 4, 0 (but that's over-saturating a bit... still fun). materials: [ { name: "untitled_scene.02___Default.004", diffuse: [ 0.251, 0.1686, 0.0314 ], }, { name: "untitled_scene.02___Default.003", diffuse: [ 0.2275, 0.502, 0.1765 ], }, { name: "untitled_scene.02___Default.002", diffuse: [ 0.9059, 0.9059, 0.9059 ], }, { name: "untitled_scene.02___Default.001", diffuse: [ 0.2157, 0.2157, 0.2157 ], }, { name: "untitled_scene.02___Default", diffuse: [ 0.2392, 0.6902, 0.5804 ], }, { name: "untitled_scene.02___Default_Slot__6", name: "untitled_scene.02___Default_Slot__7", name: "untitled_scene.02___Default_Slot__8", name: "untitled_scene.02___Default_Slot__9", name: "untitled_scene.02___Default_Slot__10", (6-10 are all set diffuseColor black) } ], Quote Link to comment Share on other sites More sharing options...
Myjestic Posted October 21, 2017 Author Share Posted October 21, 2017 Hey Wingnut, thanks for your help. I tried with the data you wrote and what I see in the debug layer. The only difference between sandbox and editor is the light. If I add the light in the editor I see the shape of my mesh, but colors are still missing. In sandbox everything is colored. I will insert the mesh in my game and add a light source, hopefully the colors are there. Quote Link to comment Share on other sites More sharing options...
Myjestic Posted October 21, 2017 Author Share Posted October 21, 2017 I tried in my own scene and everthing works like a charme if I add light. Maybe there is something wrong after importing the mesh in the editor. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 21, 2017 Share Posted October 21, 2017 Yep, adding (or including) a light... in the editor... seems to be required. The sandbox apparently adds a light FOR us. I added a pointlight on your scene (with the editor)... it worked. But, no colors. I chose alaman -> Sub-Meshes -> untitled_scene.02___Default.003... in the right-side list. Then I chose Std Material tab on left side... and Diffuse Color showed 1, 1, 1. (it's not supposed to be that value). ALL of the materials... are set 1, 1, 1, in the editor... for your scene. Strange. SO, yes, I think the editor has broken material diffuse colors. Good catch, Myjestic! Luaacro will probably visit soon. I should have checked this before I sent my last email... sorry. It was my first time using the editor. Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 28, 2017 Share Posted October 28, 2017 Hey @Myjestic, You are right, the Editor do not create a default light for you, it just keeps your scene untouched as you are ready to design more your scene (what you cannot do with 3ds Max exporter or Blender exporter) Anyway, as you saw, you can add one and configure it. I'm now checking why diffuse colors are white! Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 28, 2017 Share Posted October 28, 2017 Looks like the problem doesn't come from the editor. In the class "FilesInput", I can see that all the diffuseColor values are equal to (1, 1, 1) I'm investigating right now Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 28, 2017 Share Posted October 28, 2017 Ok found the issue! The issue came from a conflict (as information for @Deltakosh): - In materials, all "diffuseColor" members were serialized as "diffuse". - In the custom material builder of the editor, the "diffuseColor" member was serialized as "diffuseColor" which created a conflict I'm updating the editor right now! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 28, 2017 Share Posted October 28, 2017 Updated! Wingnut and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Myjestic Posted October 31, 2017 Author Share Posted October 31, 2017 @Luaacro Nice. Thank you! 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.