If it needs to go towards/away from a mesh, you can look at mesh-distance fields. They can create a true-to-form gradient (alpha) you can then exploit.
I was actually looking at old bookmarks; serendipitous: Distance Field Flow Map
EDIT, if you are also using UE5 w/lumen, distance fields are already being used, so why not leverage the expense. You can do a lot of nifty, ‘reactive’ type of material effects w/them.
ref - Lumen Technical Details | Unreal Engine Documentation
" Software Ray Tracing
Lumen uses Software Ray Tracing against Signed Distance Fields by default. This tracing representation is supported on any hardware supporting Shader Model 5 (SM5), and only requires Generate Mesh Distance Fields to be enabled in the project settings."