Changing custom depth render through blueprints for all possible objects.

Hi,

I posted this in the content creation section earlier but realized that isn’t the spot for questions like these.
In my project I have an outline shader to mark important objects the player needs to always know about.
I want to be able to turn off the effect for objects if they don’t have to be visible anymore, I know you can’t do this with the shader since it’s active globally.
I tried doing it with c++ and blueprints but not every object is the same type so the casts to a component that has the flag able to be set, fails.
Another problem is that you can’t know how deep down in the hierarchy the object you need to enable/disable is.

Anyone know how you can do this?

Looking at the source for 4.6, there’s a console variable to disable CustomDepth which might be helpful for your purpose:


static TAutoConsoleVariable<int32> CVarCustomDepth(
	TEXT("**r.CustomDepth**"),
	1,
	TEXT("0: feature is disabled
")
	TEXT("1: feature is enabled, texture is created on demand
")
	TEXT("2: feature is enabled, texture is not released until required (should be the project setting if the feature should not stall)"),
	ECVF_RenderThreadSafe
	);