www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Wolf17 on March 03, 2015, 03:01:08 pm

Title: Shadow map not updating with updated light positions and directions.
Post by: Wolf17 on March 03, 2015, 03:01:08 pm
    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 ) .
Title: Re: Shadow map not updating with updated light positions and directions.
Post by: EgonOlsen 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.