Foliage Culling

No matter what I do, I can’t seem to get the “Start Cull Distance” to do anything. According to the docs:

In the vertex shader, a per-instance fading factor is calculated, which goes from 1.0 at the start distance to 0.0 at the end distance. This is passed to the Material in the alpha channel of the the Vertex Color Material node.

All I ever seem to get is 1. Is there anything that I missed?

If it helps, here’s what I have ATM:

  • Using ordinary cube as a static mesh

  • Material is simple Vertex Alpha → Base Color

  • Start Cull = 10, End Cull = 1000

I can see the cluster disappearing once it goes out of the End Cull range, but there is no change in color in between.

Bump…

Just found the answer. There is a node called PerInstanceFadeAmount which contains the fade information.

I would suggest updating the documentation (https://docs.unrealengine.com/latest/INT/Engine/Foliage/index.html ) to avoid others having the same problem in the future.

I had the same problem, update the documentation plz !

Hey I know its not a big deal but docs are still out dated on this :wink:

Where is PerInstanceFadeAmount? I can’t find it. When you say node, is it in blueprint or somewhere in the foliage editor?

Its been a while, but yeah. You find the PerInstanceFadeAmount node in material blueprints: multiply it with the diffuse alpha and plug it into Opacity Masks, this opened a new world for me. There’s documentation on this though.

Watching the foliage disappear in shader-complexity vision I wonder if it’s that good?
Instead of a “good” (Green) mesh it gets leaves a “bad” to “extremely bad” invisible mesh behind. Any thoughts?

http://i.imgur.com/LPXY0kL.png

Yeah, the leaves disappear and I think in order for the perinstancefadeamount node to work as intended you gotta play alot with the settings; I gave it up as it left me with bare trees and didn’t look that good.

Since PerInstanceFadeamount made my instances vanish too fast I’m controlling it with an added value and then multiply it with the opacity mask.

The problem imo is that the cluster of foliages is not really working that well. According to the wiki the foliage instances are automatically clustered into groups. But to me it seems I can’t really control at what threshold the clusters are created? At the moment plants can be pretty far apart from each other but still dont cluster into seperate groups.
Does anyone know a solution to that?