The object's shadow appears cut when it's moved over certain areas (i'm using blender game engine and GLSL shadows). I've tried flipping faces and that doesn't seem to be the problem.
-
$\begingroup$ We need more info. Can you give us some screenshots? The blend file maybe? $\endgroup$– CubitCommented Jun 9, 2016 at 15:01
-
$\begingroup$ I've also deleted the entire floor object (plane) and added it again but the same thing happens even when I use different floor geometries such as grids and cubes. Also when I move the entire plane relative to the character over all areas that shadow cut doesn't happen. $\endgroup$– Daniel CaoiliCommented Jun 9, 2016 at 15:10
-
$\begingroup$ This looks a lot like a bias problem with buffer shadows. Unfortunately, I don't know enough about the BGE to be of more help. $\endgroup$– MattCommented Jun 9, 2016 at 15:16
-
$\begingroup$ Welcome to BSE, providing more details will help you get more accurate results, uploading your .blend file is even better, otherwise, all answers would be based on assumptions and guessing. You can upload your file here: blend-exchange.giantcowfilms.com $\endgroup$– Georges DCommented Jun 9, 2016 at 16:19
1 Answer
This is because the shadows are only projected from geometry within a limited area around the sun lamp. To visualize this area, enable Show Shadow Box in the lamp's settings:
This makes the cause much clearer:
The solution is to make the sun lamp follow your character (or camera) so that objects near the view are always within the "frustum".
The simplest way to do this is by vertex parenting the lamp to your model:
- Select the lamp
- Select the model
- Switch to edit mode (↹ Tab)
- Select a single vertex
- Press ⎈ CtrlP and select Vertex Parent
Now the lamp will follow that vertex's location without rotating:
Projecting shadows is relatively memory and processing intensive, so the smaller this area is, the better. You can adjust the size with the clipping settings:
You'll likely want to optimize the frustum size for what is visible from whatever camera view you end up with, such that the shadow boundary isn't in the foreground and overtly apparent.