Shadow pop-in/out

I’m wondering if anyone knows how I can avoid having shadows pop out/in for meshes that use a lot of fine alpha masking (like tree leaves).

Here’s an example of what I mean:

Strangely this doesn’t seem to be an issue while in the editor:

This is not due to LOD transitions, as this happens even when I force LOD0. There’s something happening with how the materials are streaming i think…

Any ideas?

Thanks

Figured it out. The problem was my alpha mask channel was not well defined enough. The mask was not pure white where it needed to be, so strengthening it sorted it out.

Glad you figured it out. How do you make your trees by the way? They look great. They’re not SpeedTrees are they? You can chop down trees in your game, right? So I’m assuming they can’t be foliage or static meshes.

Thanks @Nathaniel3W. These new trees are static meshes. I’m moving away from speedtrees as I can’t move to the full engine source with speedtree.

I’ve created my own tree class and am using vertex painting for trunk, branch and leaves wind animations. I don’t currently have trees falling in my game, although this would be fairly simple by swapping out the meshes at runtime or showing visual damage on the static tree using masks in the materials + decals etc.

In my game I’ve built a system for swapping out distant meshes with instanced static meshes, which has allowed me to render large landscapes with trees, building etc inexpensively (low draw calls). Even though UDK doesn’t offer any native classes to easily make use of the instanced static meshes that it supports (that the foliage and particle systems use), it can be done by creating an actor that attaches an InstancedStaticMeshComponent and you can update it by editing the PerInstanceSMData array. Without this my game would run at less than 10 fps.