gryff Posted July 29, 2014 Share Posted July 29, 2014 The BJS functionality for the Directional Light in scenes exported from Blender behaves in a way that is different from what I expect. An issue that I ran into a number of weeks back and brought back to me a few days ago by a post on JCPalmer's thread : Tower of Baylon Released I posted some examples of the behaviour on that thread as well as an image of how Directional Lights function in Unity 3D (scroll down). In particular, this example of a row of blocks with the Directional Light placed in front of the blocks and close to them: Example 3 Result: Some shadows missing and those that are produced are at an angle (normally, rays of light are parallel with a Directional Light) This is another example (image below). In Blender I have placed the Directional Light behind a row of blocks with the light pointing away from the blocks(A). The image also includes a render of the scene in Blender( - note shadows are parallel and the direction follows light direction.. Blender is not worried about the position of the light, just the direction(rotation). However, this is what the same scene looks like when loaded as a BJS scene: Example 4 Again we get the black notch and no shadows at all. However, the correct block faces are illuminated correctly. No idea why I am seeing these behaviours. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 30, 2014 Share Posted July 30, 2014 Shadows maps are a bit different. They use a direction AND a position (more like a spot to be honest but without the angles limitation) They are not really directional shadows. That why you see all this "weird" behaviors Quote Link to comment Share on other sites More sharing options...
gryff Posted July 30, 2014 Author Share Posted July 30, 2014 They are not really directional shadows. That is the conclusion I came to - kind of a best attempt at true Directional Light. I guess when using Directional Light to get reasonable results, it is best to remember to not put the light too close to objects in the scene. cheers, gryff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 30, 2014 Share Posted July 30, 2014 Yes absolutely But I'm thinking also about adding support for shadows for point light and for true directional in a new version Temechon, adam and Dad72 3 Quote Link to comment Share on other sites More sharing options...
gryff Posted July 30, 2014 Author Share Posted July 30, 2014 But I'm thinking also about adding support for shadows for point light and for true directional in a new version DK: That would be good if it is doable without a serious hit on performance Funny you should mention the Point Light as looking at Example 3 above, that looked to me more like shadows were created with a Point Light - rays of light coming from from a sphere and perpendicular to the sphere surface, as opposed to rays of light parallel to each other. I even wondered what it would take to make Point Lights cast shadows ? But in the meantime people, be careful with the placement of Directional Lights cheers, gryff Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 30, 2014 Share Posted July 30, 2014 I am totally for a better shadow system in general. Right now, I can't add shadows in my projects at all, because I work with big structures (big buildings for example, or even a city) .Maybe I'm missing something, but I always have some kind of weird shadow 'cut' because my shadow map is not big enough. Shadows for spotlights could be cool too! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 30, 2014 Share Posted July 30, 2014 For big scene you should think about different lights to "cascade" shadow maps Quote Link to comment Share on other sites More sharing options...
monkeyface Posted September 20, 2015 Share Posted September 20, 2015 i am also struggling with this... in other engines i am used to directional lights just needing a direction... having shadows generated from a particular light direction makes it really hard to just have a single far-away light source like the sun. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2015 Share Posted September 20, 2015 This is a rather old discussion, we have fixed the shadow engines since then. You can now use directional lights with no issue Quote Link to comment Share on other sites More sharing options...
monkeyface Posted September 20, 2015 Share Posted September 20, 2015 This is a rather old discussion, we have fixed the shadow engines since then. You can now use directional lights with no issue Really? I am still finding the shadows get worse as I move around the scene...as if I am getting too distant from the light. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 21, 2015 Share Posted September 21, 2015 Oh I thought you talked about light positioning (which is no more required for directional) As we do not have cascading shadow maps, yes the distance is still a problem (you can increase shadow maps size) Quote Link to comment Share on other sites More sharing options...
monkeyface Posted September 21, 2015 Share Posted September 21, 2015 Oh I thought you talked about light positioning (which is no more required for directional) As we do not have cascading shadow maps, yes the distance is still a problem (you can increase shadow maps size) I can't really increase the map size enough... I am trying to run it on mobile... so I hit the performance limit pretty fast. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 21, 2015 Share Posted September 21, 2015 Gotcha! What about having different lights based on distance? (And turn off some of them depending on where the camera is) Quote Link to comment Share on other sites More sharing options...
monkeyface Posted September 22, 2015 Share Posted September 22, 2015 Gotcha! What about having different lights based on distance? (And turn off some of them depending on where the camera is) I'm trying to make a large open world... I guess for now i'll just have to have a pointlight follow the character around and bake the rest. +10 upvote for CSMs GameMonetize 1 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.