Lunarovich Posted May 9, 2015 Share Posted May 9, 2015 Alright, this seems like a pretty important issue to me. As it is desirable and expected, directional light shadows are culled (not showed/displayed) when the camera is far away from the object: it has to be within the range of 30m or so, as I've seen so far, in order that shadows get rendered (at least with default light quality). However, when camera is set far away from the object, but zooms in so that it appears very near to the object, shadows are not rendered either. If you think about it, that is a highly unrealistic behavior: Imagine a camera that simulates binoculars. If we look through our binoculars, we are supposed to see the object as if it was near us. In that case, we would see shadows it casts if it is lit by the sun, no matter how far away our binoculars from the object actually are. However, with current LE settings it seems not possible to set cast shadow rendering distance based on the camera zoom level (I'm not sure if it's possible at all, btw - I've read some past threads and no one seems to give a definitive answer). So, a simple improvment on the shadow culling calculation - which would consist in inclusion of dividing camera distance by its zoom level - would be an easy modifcation and more than welcome. At least, IMO. P.S. I've tried setting light's quality to max. It does not solve the issue. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted May 9, 2015 Share Posted May 9, 2015 This is undocumented, but see the DirectionalLight::shadowstagerange[4] member. It will do what you want. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Lunarovich Posted May 10, 2015 Author Share Posted May 10, 2015 Thanks for the answer. Is there a way to set it with Lua? For the current project, I'm not using C++. Anyway, does this setting has anything to do with the zoom or just makes shadows visible from a longer distance? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 10, 2015 Share Posted May 10, 2015 It controls the falloff of each shadow stage. I will add it to the Lua header so it is accessible. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Lunarovich Posted May 11, 2015 Author Share Posted May 11, 2015 Great! Thank you very much. Btw 1, I've hit the strange issue of point light reflection on the static surface. I've run test on two different Windows with AMD: desktop and laptop. Namely, if I do a very large zoom on the cast light - the camera still contains the entire reflection in its view -, it starts to flicker on the desktop: the reflection is displayed every other frame. On the laptop, the cast light disappears completely as if there were no light. Btw 2, wouldn't it be also OK to take account of a camera zoom when calculating the visibility of the shadow, as I've suggested in the first place? EDIT Point light flickers even on lower zoom levels when partially inside the camera view. Turning off the occlusion culling solves the problem. Should the light filcker with the occlusion culling enabled? EDIT The central issue of this thread, ie. shadow culling when camera far away and zooms in, does not happen with point light cast shadows. Is this the inconsistent behavior? 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.