RaananW Posted October 23, 2014 Share Posted October 23, 2014 Hi guys, I am trying to understand the fundamental concepts of direction light and the shadow generator, and how to combine them both. I am playing with the shadows demo from the playground - I have removed light2 (well, commented it ) I have added another sphere to show me the direction's position (the new sphere's position is light.direction) Light direction is -1, -2, -1 . So far so good. Example here - http://playground.babylonjs.com/#XOOY7 , and everything is working fine. Now I do the following - I change the light's direction to -1,-1,-1. I wouldn't have expected Any major difference (shadow should move a bit, it should still be generated for the entire object). What happens is this - http://playground.babylonjs.com/#XOOY7#1 . Part of the shadow is simply cut out (Lower right corner, in case you haven't changed the camera perspective). Ok, I then decided to keep on experimenting. I have changed the direction to -1, -20, -1 . Once again, I have expected that there won't be a major difference in the shadow (I have just moved the light's y a few units (well, 18 ) down. This is how it looks like - http://playground.babylonjs.com/#XOOY7#2 This time, the upper left corner is somehow filtered out. I have continued to change the direction property a few more time, but the only time a real full shadow appeared was when it was -1, -2, -1. I have also played with the light's position, it was still very hard to get the shadows working with different configuration. I do believe my major misunderstanding is about the direction property of the directional light. The direction is the point to which the light source is directed to. Light is emitted from everywhere, which means that technically objects should be lit from the bottom as well. The position property of the light is just for the shadow generation. Otherwise it is not really used (I hope I got that right). What am I missing? Why is the shadow not working correctly? Quote Link to comment Share on other sites More sharing options...
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.