Material color based on visibility

Hi!

I am trying to make a visibility check application for environmental impact. I am pursuing a way to indentify the areas that are visible from a given point (P) by tinting the materials of the objects present in the scene based on their visibility from that point. I would like that P could be moved to analize the scene interactively

A possible solution could be to place a light in P and consider the visibility of areas of the scene based on its shadow, but I can’t find a way to check in the material editor whether the point in the surface of an object receives the effect of a given light or ir falls into its shadow.

Have you got any idea to get what I’m looking for?

Thanks to all in advance.

I dont think you can use the light information to determine visibility with blueprints only. What you can do is use a sphere trace from Point and get the materials of the hit components, then compare those materials with the specific one you like.

Impossible with BP only but there may be a way with C++. You should ask around in the C++ section of the forum.

Oh wait…Watch this 2 part tutorial: - YouTube

I think you can use this for what you want to achieve.

And maybe even Custom Depth tricks might help.

The problem is that I need to tint the objects (or parts of them, such in a building façade or the terrain itself, that can be partially visible and partially invisible) with different colours depending on their visibility from point P. Hence I need to set up materials for the objects that take that tint based on their visibility on a per pixel shader basis.

Probably I am trying to do something impossible to achieve in UE4 . :frowning:

Unfortunately, I’m not a C++ programmer. I’ll try the regular forum as well (intead of answerhub) Thank you anyway for your help.

Thank you for the examples. I will take a time to try to adapt them, specially the second one, which deals with occlusion.

Best regards!

Hey Luis, have you been able to make this per pixel change to your materials using Blueprints?

No, I haven’t. Unfortunally it seems to be impossible.

Alright, thanks for the reply.

Video is unavailable