gryff Posted May 13, 2014 Share Posted May 13, 2014 On several threads DK has mentioned changes to the parameters that can be applied to lights - range and attenuation in particular. I am using the latest version of the Blender babylon exporter (the one that addresses animation issues and file size here) but I am getting a very limited output for point light no matter how I tweak the lights properties in Blender:{"name":"Point","id":"Point","type":0.0000,"position":[7.1701,1.6286,7.2894],"intensity":0.2400,"diffuse":[1.0000,1.0000,1.0000],"specular":[0.0000,0.0000,0.0000]}Are changes to lighting properties reflected in the Blender exporter? cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 13, 2014 Share Posted May 13, 2014 Range is exported from Distance property when Sphere decay is selected (for Point and SpotLight) I see that intensity is really low on your sample (0.24) Quote Link to comment Share on other sites More sharing options...
gryff Posted May 13, 2014 Author Share Posted May 13, 2014 Hmm. The images below show my settings and the result. Image1: Shows an overhead view of a set of rooms (all one mesh) with a Point light in top right corner. The radius of the light is set to 2 metres that shows up in the Distance box. Falloff is set to Inverse Square just as in your image above. There is a dim Hemi providing some overall scence lighting- trying to create a spooky atmosphere, so I am varying the intensity value of the Point light. Here is the code for both the lights in the exported babylon file:"lights":[{"name":"Point","id":"Point","type":0.0000,"position":[7.7560,1.6286,7.8753],"intensity":1.0000,"diffuse":[1.0000,1.0000,1.0000],"specular":[0.0000,0.0000,0.0000]},{"name":"hemi","id":"hemi","type":3.0000,"direction":[-0.0000,1.0000,-0.0000],"groundColor":[0.0000,0.0000,0.0000],"intensity":0.1000,"diffuse":[1.0000,1.0000,1.0000],"specular":[1.0000,1.0000,1.0000]}]I have tried exporting using all the settings available in the "Falloff" dropdown box - get the same result as above in my babylon code. I figured it would just be a matter of getting the right settings - but my lack of success made me post this thread. Image 2: The result I am getting - the point light is reaching as far as the other end of the rooms. Maybe I should redownload the exporter and set it up in Blender again as there seems to be no mention of range/attenuation in the Point light code above. Edit: I just noticed that it must be the new exporter as it saves a camera rotation not target like my original exporter did. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 14, 2014 Share Posted May 14, 2014 Oups for some reasons the blender exported I've checked in was not the good oneThis should work now Quote Link to comment Share on other sites More sharing options...
gryff Posted May 14, 2014 Author Share Posted May 14, 2014 This should work now Well ... in a limited way I get this in the babylon file on export:{"name":"Point","id":"Point","type":0.0000,"position":[7.7560,1.6286,7.8753],"range":2.000,"intensity":1.0000,"diffuse":[1.0000,1.0000,1.0000],"specular":[0.0000,0.0000,0.0000]}So I now have a parameter/property called "range" in my babylon file. I've posted three images below to show the results I'm getting with the same blender set of rooms I posted above. The camera is in the room at lower left looking at the bookcase near the cursor symbol (crosshair with red and white circle). Image1: The point light is turned off -just a dim Hemi. Image2: Point light on with dim Hemi - Range set to 2. The bookcase is 10+ units away from the light. Note the left wall, the bookcase and the books. Image3: Point light on with dim Hemi - Range set to 20 I can subtract image2 from image1 - the result is a complete black image i.e. - there is no difference. Why is the bookcase in image2 receiving light from the point light - not to mention the books and the left wall? I thought perhaps that as all the walls are a single mesh and that if part of the mesh was in the range then the whole mesh was affected, but the books and bookcase are two additional seperate meshes and are still affected at Range = 2. I tried this with babylon 1.11.js and the beta babylon 1.12.js - same results. So yes the exporter now gives a range parameter - but it seems to have no impact, unless I am totally missing something. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 I must have a bug:) could you send me the .babylon (and textures) used for your test? Quote Link to comment Share on other sites More sharing options...
gryff Posted May 15, 2014 Author Share Posted May 15, 2014 Have sent you a PM with a link to a zip file of the babylon file, all textures, even the html page I use to load the scene. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 After analysis I think this is normal The normal of your wall implies that the wall cannot receive light from your point light. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 15, 2014 Author Share Posted May 15, 2014 After analysis I think this is normal The normal of your wall implies that the wall cannot receive light from your point light. Hmm. If you look at the two images above (Range=2 and Range=20) the wall on the left side is receiving light, as are certain faces on the books and bookcase. Really don't understand what you are trying to say. But I will use a simpler example. Try it here: Cubes and lights The scene was built in Blender 2.69. It contains three standard cubes, a standard plane, and a standard cone. There are two lights - a dim Hemi and a Pointlight at position 30,30,30. I used strictly standard Blender objects from the "Add" menu - no messing with geometry or normals. The cone represents the X,Z position of the light (babylon axis) but the light is 30 units above it. The three cubes are at these positions (babylon axis) Green : 0,0,0Red: -10,0,-10Blue: -20,0,-20 The "range" of the Pointlight is set to 1. So why is the blue Cube receiving light - it is way outside the " range" of the Pointlight - 70+ units from the light? In fact why do any of the objects in the scene receive light from the Pointlight.? What exactly is this "range" parameter influencing? The zip file for this demo is here: cubes.zip. So anyone can try it and experiment. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 In your first example I was talking about the fact that back faces of the wall cannot receive lighting from your lightI'm investigating your second sample Quote Link to comment Share on other sites More sharing options...
gryff Posted May 15, 2014 Author Share Posted May 15, 2014 In your first example I was talking about the fact that back faces of the wall cannot receive lighting from your light Ahh OK - I expected that as the normals are pointing a different way. I had assumed that by limiting the "range" I could stop light reaching the left inside wall as well. I assumed that "range" meant that light could reach only objects/faces inside that range - an easy exclude meshes for a scene created in blender with many objects. Sorry if this is taking up a lot of your time. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 No problem: and you are right the range seems buggy for now Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 Are you sure you're using the last version for github? Because on my version the range is working as expected Quote Link to comment Share on other sites More sharing options...
gryff Posted May 15, 2014 Author Share Posted May 15, 2014 My last download for babylon.1.12-beta.js is dated 13/5/2014. I will check though. cheers, gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted May 15, 2014 Author Share Posted May 15, 2014 Okay it looks fine now. I had babylon.1.12-beta.js dated 10/5/2014 on my local webserver Works like a charm with the 13/05/2014 version. See attached images range =2. TY DK - you have made my day. Apologies for any grief I may have caused. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 15, 2014 Share Posted May 15, 2014 Oh yes sounds like an horror movie:) 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.