3
$\begingroup$

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.

enter image description here enter image description here

$\endgroup$
  • $\begingroup$ We need more info. Can you give us some screenshots? The blend file maybe? $\endgroup$ – Cubit Jun 9 '16 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 Caoili Jun 9 '16 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$ – Matt Jun 9 '16 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 Jun 9 '16 at 16:19
3
$\begingroup$

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:

enter image description here

This makes the cause much clearer:

enter image description here

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:

  1. Select the lamp
  2. Select the model
  3. Switch to edit mode (↹ Tab)
  4. Select a single vertex
  5. Press ⎈ CtrlP and select Vertex Parent

enter image description here

Now the lamp will follow that vertex's location without rotating:

enter image description here

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:

enter image description here

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.

$\endgroup$
  • $\begingroup$ THAT WAS A GREAT ANSWER $\endgroup$ – Daniel Caoili Jul 3 '16 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.