KevinK Posted May 14, 2018 Share Posted May 14, 2018 I am having problems with meshes and lighting when importing (appending ) glb files into a scene. I Use BABYLON.SceneLoader.AppendSync( "file:", sceneFile, scene, ...... ). The image below has a box on the left that has been appended to scene, and a box on the right that was created directly to the scene. The one on the right is being lit properly by the spot light. The one on the left is not. It is hard to tell but the box appended to the scene appears to have the normals reversed. The appended box has the parent "__root__" node. The scene is set to useRighthandSystem == true, If I change the scene to UseRighthandSystem == false after import, the left box normal's are reversed, but still do not get lit by spotlight. Any thoughts I why I cannot get the appended glb file to light( show) properly. Thanks, Quote Link to comment Share on other sites More sharing options...
KevinK Posted May 15, 2018 Author Share Posted May 15, 2018 17 hours ago, KevinK said: I am having problems with meshes and lighting when importing (appending ) glb files into a scene. I Use BABYLON.SceneLoader.AppendSync( "file:", sceneFile, scene, ...... ). The image below has a box on the left that has been appended to scene, and a box on the right that was created directly to the scene. The one on the right is being lit properly by the spot light. The one on the left is not. It is hard to tell but the box appended to the scene appears to have the normals reversed. The appended box has the parent "__root__" node. The scene is set to useRighthandSystem == true, If I change the scene to UseRighthandSystem == false after import, the left box normal's are reversed, but still do not get lit by spotlight. Any thoughts I why I cannot get the appended glb file to light( show) properly. Thanks, Additional info, If I Use the same appendSync function with obj files it works fine. Also, if I use a directional light, the box is still dark. If I use a hemi-light, the colors and material appear. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 15, 2018 Share Posted May 15, 2018 This is because glTF uses PBR and PBR uses a different system for lights: http://doc.babylonjs.com/how_to/physically_based_rendering#light-setup for the right handed question, you set the __rootNode__.scaling to (1, 1, 1) Quote Link to comment Share on other sites More sharing options...
KevinK Posted May 15, 2018 Author Share Posted May 15, 2018 Thanks 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.