UDK/UE3 trees shadow/lighting flicker

I have some trees that cast shadows on the ground and on themselves. Their lighting/shadowing flickers when the camera moves. When the camera stops moving, they’ll stop flickering after a second or two. It looks really bad. What can I do to prevent them from flickering?

I’ve narrowed down the problem to how the see-through leaves work. I have a screen-space effect that pokes extra holes into the transparency mask if the leaves are in the center of the screen, and if the pixel depth is under a certain threshold.

If I use pixel depth, then the shadows are permanently off and there’s no flickering. If I get distance between camera location and world location, then the shadows are on, but they flicker. I think the engine can’t decide whether to cast shadows or not.

If something like that happened in my game, I would solve it by baking the lightmap.

1 Like

That was what I thought at first too. But my game has all dynamic lights. Maybe I need to replace the dynamic lights wherever possible (especially with the directional light). I think I may have found a solution though, by carefully tweaking the parameters on the material. Hopefully I can make that work.

1 Like