Author Topic: Shadow map not updating with updated light positions and directions.  (Read 1609 times)

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
    I am using the shadow mapping example  provided by Egon (Thanks again!) . I experimented a little
and then tried to update light position and direction in real time. But somehow  I was not able to see any changes in the shadowmap blit and the scene too ,when I changed the position and direction of light(I am using directional light present in Thomas' sampls ) .

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Shadow map not updating with updated light positions and directions.
« Reply #1 on: March 03, 2015, 05:46:39 pm »
If you are using the code from the example, that's because i bound the calculation of the corresponding values to this statement in updateProjector():

Code: [Select]
if (light != null && projectionMatrix == null) {
...
}

If you comment this statement out, it should update correctly. However, it creates some garbage objects this way in each frame. So it's better to do it in case of a real change in position or direction only.