How can you render a custom depth for foliage?

I’m a seasoned Blender user, able to make anything but people with ease or time. I could probably learn how to model people if I really wanted to but with a wonderful tool like MB-Labs there’s really no reason, for it would drastically reduce my game production time. Anyhow, I’ve been exploring UE4 after getting my dream machine thanks to Trump’s Stimulus Dump and everything has been fine and dandy. I created my custom toon shader, which requires custom depth. I made my game framework, with the help of Virtus Education on youtube. I even created a custom map to show my testers my progress but suddenly, I hit a huge snag. Instanced foliage doesn’t seem to have custom depth.

As static mesh based, they should have this feature. I can drop the same tree in the level and check it without a problem but when it comes to selecting foliage, there is no option for it. What is the use of my expansive plant library that I accumulated over the years of being a UE4 fan when they are incompatible with my shader? I’ve searched the net and haven’t found much about it, since this is a rare occurrence. Not many people use a post process shader, which requires custom depth to display right. My carefully constructed game world would shatter if the tress and grass wasn’t rendered in the same style as the characters and buildings. Can anyone advise me on what to do that doesn’t drastically increase the requirements for my game?

Would converting the trees into mesh then checking the custom depth drastically spike the performance? Or should I opt for lower poly hand made stuff that has custom toon textures, place then convert them?

I found a way, in the foliage type, select the mesh and under instance settings, there’s an option that says Render Custom Depth Pass just activate it and it should work.


Does this not exist in UE5? I am looking for it but cannot find it. Should the setting be here?