Download

Distance culling with speedtree

Hello .
i’ve been playing with speedtree , so i made a tree in the modeler around 10k vertices , imported it into UE4 with its material . then i used the foliage tool to instance it over the map , at certain point i noticed a dramatic decrease in fps .
So i searched the forums , people suggested to use LOD’s and distance culling . the tree already has 2 LODs along with it , so i focused on the culling .
The problem is when in the foliage brush , i set an amount for Start cull distance/ end cull distance , tree doesnt fade out or fade in , it pops in or pops out . and not just 1 tree at a time , the entire brush acts as a whole , i mean when i get to the distance where the closest instanced tree should fade in , the entire jungle pops in and not just the closet tree .

I want each instance to fade in/out when they should and not all of them pop in/out together .
Also there is this “PerInstanceFadeAmount” node in the material editor , but i’m not sure how to use it . anyone can help me on this ? thanks in advance.

Thanks for the reply . Where does the node “PerInstanceFadeAmount” comes in ? is it not useful in anyway ?

The problem is i’m creating a jugle map , which as you can guess , is entirely composed of trees , there is nowhere that is not trees . for example , i’m standing in the middle of the jungle , there are trees around me , and i want the distant trees to fade out/pop out so the fps would go higher than 10 . but since the whole jungle acting as a whole , and there is alway trees around me , it never gonna cull anything . this “all or nothing” doesnt seem useful to me .

For instanced foliage, there is no speedtree-style smooth LOD because the lod is switched per clump instead of per tree. That’s basically the same as switching the SpeedTree node to pop instead of smooth. So in that case, you’re just controlling when the change happens to the next LOD… and changing the lod values as you did is perfectly fine.

However, if you’re placing the tree as an individual actor, smooth LOD will work. Making the highest LOD value of 1 will make the smooth lod start changing immediately as you’re walking away from the tree. That looks pretty weird when you’re an arm’s reach away from the tree and you can see a knothole scaling away or something. Better for that to start a little further away.

Perhaps we could have an option on the importer for how you will use the tree: instanced or individual. Then we can set up the LOD values accordingly.

And of course, LOD is all about tweaking, so things vary from tree to tree anyway :wink:

I dont know why , but this “PerInstanceFadeAmount” doesnt seem to do anything for me , i tested it on multi-material trees or single material grass . it doesnt make any difference . it doesnt pop/fade them per tree or anything of sort . the only difference is if i put any value in the start cull distance/end cull distance , as long as the end cull is greater than the start cull , mesh is practically invisible , it appears that foliage brush is painting nothing , but it actually is , since the number is going up . if start cull distance /end cull distance are at 0 they just render as before , no difference , no fading/popping per instance .

Here is a the shader that i’m using , can you check to see if anything’s wrong with it plz ?