Bman84 Posted May 11, 2016 Share Posted May 11, 2016 So, I am trying to make a room, lit up with some lights. I use blender v2.77a on GNU/linux, blenderexporter 4.4.4 and I am testing the result in the babylonJS sandbox online. l the walls have the same purple material, the floor has a gray material and the two boxes have a red solid material. The light is a spot light, under a certain angle, and a larger size, the light values are otherwise unchanged from default. You can see the the issue in the attached files, the babylonresult.jpg looks crazy compared to what blender "previews". The middle wall is lit on both sides, even though the light is on one side only, there are no shadows, the rightmost wall is not lit at all and the light on the floor seems constant, regardless of distance from source. Can someone please point me into a direction where I can learn of my wrongdoings? The .blend, .babylon and the log are also attached. Thank you in advance! Borut ctest.blend ctest.babylon ctest.log Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 11, 2016 Share Posted May 11, 2016 Sorry not a lot of time today. Best guess looking the pictures (did not read the text), you have a normals / culling problem. The inside of the cube is the backside. If you are never going to see both the inside & outside of a mesh, flip your normals in Blender. switch to edit mode select all (A) menu: Mesh->Normals->Flip Normals If you do need to see both, turn off culling. For entire manual, see Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 11, 2016 Share Posted May 11, 2016 Hi guys. Welcome to the forum, @Bman84! http://www.babylonjs-playground.com/#2FNT2E#4 Tested our spotlight range settings (lines 47-50)... working fine for spotlight falloff. Checking bottom of bman's .babylon file... "lights":[{"name":"Spot","id":"Spot","type":2,"position":[-2.7973,3.4862,-5.8656],"direction":[0.433,-0.5,0.75],"angle":1.3963,"exponent":0.3,"intensity":1,"diffuse":[1,1,1],"specular":[0,0,0]}], "shadowGenerators":[] } ShadowGenerator array is empty, and no mention of any "range" for that light. So... yep... we got trouble... right here in River City. Bman, please look for reasons why Blender might not include those things... in its exports. I'm sure JC and other pros on this subject... will comment more soon. Again, welcome, Bman... and thanks for finding this issue... well done. (Wingnut tries waving a magic wand to make it all better, but it has no affect.) Quote Link to comment Share on other sites More sharing options...
gryff Posted May 11, 2016 Share Posted May 11, 2016 Hi Bman84, welcome to the forum:) The reason there are no shadows is, as Wingy points out, you have not created a shadow generator and not set the properties of objects that cast and receive shadows . (See image below.) 1. Objects that cast/receive shadows - Select each object then in the object properties (little blue triangle) you will find the exporter (4.5 in my case) check the appropriate boxes (A in image below). Do that for all the objects that will be involved. So floor and wall objects will "receive shadows", middle wall/boxes will "cast shadows". 2. The Light - This is the cause of the shadows and you need to create a shadow map. Select the light then chose the type of shadow map from the drop down box in the exporter properties for the light.. (B in the image below) Will look at it more later today. cheers, gryff Quote Link to comment Share on other sites More sharing options...
razieh Posted October 1, 2018 Share Posted October 1, 2018 On 5/11/2016 at 8:06 PM, Wingnut said: Hi guys. Welcome to the forum, @Bman84! http://www.babylonjs-playground.com/#2FNT2E#4 Tested our spotlight range settings (lines 47-50)... working fine for spotlight falloff. Checking bottom of bman's .babylon file... "lights":[{"name":"Spot","id":"Spot","type":2,"position":[-2.7973,3.4862,-5.8656],"direction":[0.433,-0.5,0.75],"angle":1.3963,"exponent":0.3,"intensity":1,"diffuse":[1,1,1],"specular":[0,0,0]}], "shadowGenerators":[] } ShadowGenerator array is empty, and no mention of any "range" for that light. So... yep... we got trouble... right here in River City. Bman, please look for reasons why Blender might not include those things... in its exports. I'm sure JC and other pros on this subject... will comment more soon. Again, welcome, Bman... and thanks for finding this issue... well done. (Wingnut tries waving a magic wand to make it all better, but it has no affect.) is it possible that we have a realistic light... Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 1, 2018 Share Posted October 1, 2018 Yes, see http://www.html5gamedevs.com/topic/37968-lamps-on-babylon-open-contest/ Whether this can be expressed in a JSON (.babylon) file, or further into one made by Blender is unknown. Let us know. Good luck. 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.