|Topic was automatically imported from the old Question2Answer platform.
I try to achieve the following effect :
I have a 3D floor (let’s say a plane, but it could be any mesh) : F
I have a 3D point in space : A
I have a given radius : R
I would want the floor to be red where the distance to A is inferior to R.
The goal is to vizualize the distance to point A (which could be my character for instance) on the ground. Idealy the red zone is semi-transparent so I can see part of the real floor material (but I don’t think this is the difficult part).
From what I understood, I think making a shader could be the answer , but I don’t know how to set the color of the fragment depending on the distance to a 3D point. I would appreciate yout help on this one